:root {
    --primary: #1677ff;
    --primary-light: #e6f4ff;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg: #f5f5f5;
    --white: #fff;
    --border: #eee;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --nav-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

html, body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    padding-bottom: calc(var(--nav-height) + 10px);
}

.mobile-page {
    min-height: 100vh;
    background: var(--bg);
}

.mobile-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.mobile-content {
    padding: 12px;
    padding-bottom: 20px;
}

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-light);
    transition: color 0.2s;
    height: 100%;
}

.nav-item:active {
    background: var(--bg);
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 11px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 15px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:active {
    background: #1455cc;
    transform: scale(0.98);
}

.btn-outline {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:active {
    background: var(--bg);
}

.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); }

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 12px;
}

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-body {
    padding: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
}

.card-price::before {
    content: '¥';
    font-size: 13px;
    font-weight: 500;
}

.card-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
}

.list-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
}

.list-item:active {
    background: #fafafa;
}

.list-item-img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

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

.list-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.list-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}

.list-item-price::before {
    content: '¥';
    font-size: 12px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-light);
}

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

.form-row > * {
    flex: 1;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-secondary);
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #f6ffed; color: var(--success); }
.badge-warning { background: #fffbe6; color: var(--warning); }
.badge-danger { background: #fff2f0; color: var(--danger); }

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-text {
    font-size: 14px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 3px solid var(--primary);
}

.section {
    margin-bottom: 20px;
}

.swiper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.swiper-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 20px;
    padding: 8px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.search-bar-icon {
    margin-right: 8px;
    font-size: 16px;
}

.search-bar input {
    flex: 1;
    border: none;
    font-size: 14px;
    background: transparent;
    outline: none;
}

.tabs {
    display: flex;
    background: var(--white);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary);
    color: var(--white);
    font-weight: 500;
}

.qrcode {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    background: var(--white);
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.qrcode img {
    width: 100%;
    height: 100%;
}

.order-item {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.order-no {
    font-size: 12px;
    color: var(--text-light);
}

.order-status {
    font-size: 13px;
    font-weight: 500;
}

.order-body {
    padding: 12px;
}

.order-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.order-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.order-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}

.order-total::before {
    content: '合计: ';
    font-size: 12px;
    font-weight: 400;
}

.user-header {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    padding: 30px 20px;
    color: var(--white);
    text-align: center;
    margin-bottom: 16px;
}

.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--white);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-phone {
    font-size: 14px;
    opacity: 0.9;
}

.user-menu {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
}

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

.menu-item:active {
    background: var(--bg);
}

.menu-icon {
    margin-right: 12px;
    font-size: 18px;
}

.menu-arrow {
    margin-left: auto;
    color: var(--text-light);
}

.detail-header {
    position: relative;
    margin: -12px -12px 0;
}

.detail-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.detail-body {
    background: var(--white);
    margin: -20px 12px 0;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    position: relative;
}

.detail-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 12px;
}

.detail-price::before {
    content: '¥';
    font-size: 14px;
}

.detail-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.detail-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.detail-footer {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    background: var(--white);
    padding: 10px 16px;
    display: flex;
    gap: 12px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-mask.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 85%;
    max-width: 320px;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-mask.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.modal-body {
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    border-top: 1px solid var(--border);
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
}

.modal-btn:active {
    background: var(--bg);
}

.modal-btn-primary {
    color: var(--primary);
    font-weight: 500;
}

.modal-btn-danger {
    color: var(--danger);
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

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

.fade-in {
    animation: fadeIn 0.3s ease;
}
