:root {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #888888;
    --brand-color: #ffc300;
    --pending-color: #fa541c;
    --header-height: 50px;
    --tab-height: 44px;
}

/* 手机版基础样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: #e8e8e8; /* 浅灰色背景，与内容区域形成对比 */
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100vh;
}
ul { list-style: none; }
a { text-decoration: none; color: inherit; }

/* 页面容器 - 手机版 */
.page-container {
    padding-bottom: 20px;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
    position: relative;
    background-color: var(--bg-color);
}

/* 固定头部 - 手机版 */
.page-header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    padding: 0 15px;
    background-color: var(--card-bg);
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 1000;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.page-header .back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* 订单标签 - 手机版 */
.order-tabs {
    background-color: var(--card-bg);
    padding: 0 15px;
    border-bottom: 1px solid #f0f0f0;
    position: fixed;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 999;
    height: var(--tab-height);
}

.order-tabs ul {
    display: flex;
    height: 100%;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    white-space: nowrap;
}

.order-tabs ul::-webkit-scrollbar { display: none; }

.order-tabs li {
    flex-shrink: 0;
    height: 100%;
    padding: 0 12px;
    margin-right: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-tabs li.active a {
    font-weight: bold;
    color: var(--text-primary);
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 3px;
}

/* 订单列表容器 - 手机版 */
.order-list-container {
    padding: 15px;
    margin-top: calc(var(--header-height) + var(--tab-height));
    overflow-x: hidden;
}

/* 订单卡片 - 手机版 */
.order-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 15px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 15px;
}

.status { font-weight: bold; }
.status-pending { color: var(--pending-color); }
.status-cancelled, .status-completed { color: var(--text-secondary); }

.card-body {
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.restaurant-name {
    display: none;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.item-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.item-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-specs {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-details {
    text-align: right;
    flex-shrink: 0;
}

.price {
    font-size: 15px;
    font-weight: bold;
}

.quantity {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
}

.btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
}

.btn:active {
    opacity: 0.8;
}

.btn-secondary {
    border-color: #ddd;
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.btn-primary {
    border-color: var(--brand-color);
    background-color: var(--brand-color);
    color: var(--text-primary);
    font-weight: bold;
}

/* 针对不同手机尺寸的优化 */
@media screen and (min-width: 320px) and (max-width: 428px) {
    .order-item {
        gap: 12px;
    }
    
    .item-image {
        width: 65px;
        height: 65px;
    }
    
    .card-footer {
        gap: 8px;
    }
    
    .btn {
        padding: 7px 15px;
        font-size: 13px;
    }
}

/* 解决iPhone X及以上机型的底部安全区域问题 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .page-container {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}
