* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --secondary: #FD79A8;
    --accent: #FDCB6E;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --info: #74B9FF;
    --bg: #F5F6FA;
    --card: #FFFFFF;
    --text: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;
    --border: #DFE6E9;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

/* Icon styles for Font Awesome */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-lg { font-size: 48px; }
.icon-xl { font-size: 64px; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 70px;
}

.header {
    background: linear-gradient(135deg, var(--primary), #8B7CF6);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(108,92,231,0.3);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header-back {
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 50%;
    transition: background 0.2s;
}
.header-back:hover {
    background: rgba(255,255,255,0.15);
}
.header-back i {
    color: white;
}

.header-action {
    font-size: 14px;
    opacity: 0.9;
    cursor: pointer;
}

.location-bar {
    background: white;
    margin: 12px 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.location-icon {
    font-size: 20px;
    color: var(--primary);
}

.location-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-refresh {
    font-size: 16px;
    color: var(--primary);
}

.filter-section {
    margin: 0 16px 12px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.sort-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
}

.sort-tag {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    background: #F0EDFF;
    color: var(--primary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.sort-tag.active {
    background: var(--primary);
    color: white;
}

.merchant-list {
    padding: 0 16px;
}

.merchant-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.merchant-card:active {
    transform: scale(0.98);
}

.merchant-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.merchant-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.merchant-info {
    flex: 1;
}

.merchant-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.merchant-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.star-rating {
    color: var(--accent);
    font-weight: 600;
}

.distance-badge {
    background: #F0EDFF;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.merchant-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.merchant-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #FFF0F5;
    color: var(--secondary);
}

.merchant-tag.activity {
    background: #FFF3E0;
    color: #E17055;
}

.merchant-tag.group {
    background: #E8F5E9;
    color: #00B894;
}

.merchant-tag.shuttle {
    background: #E3F2FD;
    color: #1976D2;
}

.merchant-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.price-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.price-value {
    color: var(--danger);
    font-weight: 600;
    font-size: 16px;
}

.rebate-info {
    font-size: 12px;
    color: var(--success);
}

.btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    background: #5A4BD1;
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.booking-form {
    padding: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: var(--text);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.order-tabs {
    display: flex;
    background: var(--card);
    margin: 12px 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.order-tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.order-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.order-tab .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
}

.order-card {
    background: var(--card);
    margin: 0 16px 12px;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-no {
    font-size: 12px;
    color: var(--text-muted);
}

.order-status {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.order-status.status-1 {
    background: #E3F2FD;
    color: #1976D2;
}

.order-status.status-2 {
    background: #FFF3E0;
    color: #E17055;
}

.order-status.status-3 {
    background: #E8F5E9;
    color: #00B894;
}

.order-status.status-0 {
    background: #F5F5F5;
    color: #636E72;
}

.order-status.status-4 {
    background: #FFEBEE;
    color: #B71C1C;
}

.order-body {
    display: flex;
    gap: 12px;
}

.order-merchant-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.order-info {
    flex: 1;
}

.order-service {
    font-size: 15px;
    font-weight: 600;
}

.order-merchant {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.order-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.order-amount {
    font-weight: 600;
    color: var(--danger);
}

.order-rebate {
    font-size: 12px;
    color: var(--success);
}

.profile-section {
    background: var(--card);
    margin: 12px 16px;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
}

.profile-phone {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.balance-card {
    background: linear-gradient(135deg, var(--primary), #8B7CF6);
    color: white;
    margin: 12px 16px;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 4px 16px rgba(108,92,231,0.3);
}

.balance-label {
    font-size: 13px;
    opacity: 0.8;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0;
}

.balance-sub {
    font-size: 13px;
    opacity: 0.8;
    display: flex;
    justify-content: space-between;
}

.menu-list {
    margin: 12px 16px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: var(--bg);
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
}

.menu-icon.purple { background: #F0EDFF; }
.menu-icon.pink { background: #FFF0F5; }
.menu-icon.green { background: #E8F5E9; }
.menu-icon.blue { background: #E3F2FD; }
.menu-icon.orange { background: #FFF3E0; }

.menu-title {
    flex: 1;
    font-size: 15px;
}

.menu-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

.account-log {
    background: var(--card);
    margin: 0 16px 10px;
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.log-desc {
    font-size: 14px;
    flex: 1;
}

.log-amount {
    font-size: 16px;
    font-weight: 600;
}

.log-amount.income {
    color: var(--success);
}

.log-amount.expense {
    color: var(--danger);
}

.log-time {
    font-size: 12px;
    color: var(--text-muted);
}

.log-balance {
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--text-muted);
    opacity: 0.7;
}

.empty-text {
    font-size: 14px;
}

.booking-card {
    background: var(--card);
    margin: 12px 16px;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.service-option {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.service-option.selected {
    border-color: var(--primary);
    background: #F0EDFF;
}

.service-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.service-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.service-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--danger);
}

.service-original {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 8px;
}

.service-rebate {
    font-size: 12px;
    color: var(--success);
    margin-top: 2px;
}

.agreement-content {
    padding: 20px;
    line-height: 1.8;
    font-size: 14px;
}

.agreement-content h3 {
    margin-bottom: 16px;
    color: var(--primary);
}

.agreement-content p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    color: white;
    animation: toastIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--card);
    display: flex;
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--primary);
}

.tab-icon {
    font-size: 22px;
}

.rebate-banner {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    margin: 12px 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #E65100;
    font-size: 13px;
    cursor: pointer;
}

.rebate-banner-icon {
    font-size: 24px;
}

.car-service-banner {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    margin: 12px 16px;
    padding: 16px;
    border-radius: var(--radius);
}

.car-service-title {
    font-size: 16px;
    font-weight: 600;
    color: #1565C0;
    margin-bottom: 4px;
}

.car-service-desc {
    font-size: 13px;
    color: #1976D2;
    margin-bottom: 10px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 16px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}