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

/* 隐藏滚动条但保持滚动功能 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 100%;
    min-height: 100vh;
    padding-bottom: 20px;
}

/* 头部 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left,
.header-right {
    width: 40px;
    display: flex;
    align-items: center;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.3s;
}

.back-btn:active {
    background: #f5f5f5;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

/* 订单状态筛选 */
.order-tabs {
    display: flex;
    background: #ffffff;
    padding: 0 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 99;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 16px 0;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.tab-item.active {
    color: #ff3366;
    font-weight: 600;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(135deg, #ff3366 0%, #ff6b9d 100%);
    border-radius: 2px;
}

/* 订单区域 */
.orders-section {
    padding: 12px 16px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 订单卡片 */
.order-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

.order-no {
    font-size: 13px;
    color: #999;
}

.order-status {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.order-status.success {
    color: #07C160;
    background: rgba(7, 193, 96, 0.1);
}

.order-status.pending {
    color: #ff9500;
    background: rgba(255, 149, 0, 0.1);
}

.order-status.failed {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.1);
}

.order-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-info {
    flex: 1;
}

.order-phone {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.order-operator {
    font-size: 13px;
    color: #999;
}

.order-amount {
    text-align: right;
}

.amount-value {
    font-size: 20px;
    font-weight: 800;
    color: #ff6b35;
    margin-bottom: 2px;
}

.amount-original {
    font-size: 12px;
    color: #bbb;
    text-decoration: line-through;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed #f0f0f0;
    min-height: 32px;
}

.order-time {
    font-size: 12px;
    color: #bbb;
}

.order-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-outline {
    background: #f5f5f5;
    color: #666;
}

.btn-outline:active {
    background: #e8e8e8;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
    color: #fff;
}

.btn-primary:active {
    opacity: 0.9;
}

.btn-cancel {
    background: #fff;
    color: #999;
    border: 1px solid #e0e0e0;
}

.btn-cancel:active {
    background: #f5f5f5;
}

.btn-apply {
    background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-apply:active {
    opacity: 0.9;
}

.btn-pay {
    background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
    color: #fff;
}

.btn-pay:active {
    opacity: 0.9;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 16px;
    font-size: 14px;
    color: #999;
    cursor: pointer;
}

.load-more:active {
    color: #666;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.empty-icon {
    margin-bottom: 16px;
}

.empty-text {
    font-size: 15px;
    color: #999;
    margin-bottom: 20px;
}

.empty-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 40px;
    border-radius: 24px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* 详情弹窗 */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.detail-label {
    font-size: 14px;
    color: #999;
}

.detail-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.detail-value.success {
    color: #07C160;
}

.detail-value.failed {
    color: #ff4d4f;
}

.detail-value.pending {
    color: #ff9500;
}

.detail-value.price {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b35;
}

/* 详情页到账计划 */
.detail-schedule {
    margin: 16px 0;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 12px;
}

.detail-schedule-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.detail-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.schedule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid #ff6b35;
}

.schedule-row .schedule-month {
    font-size: 13px;
    color: #666;
}

.schedule-row .schedule-amount {
    font-size: 14px;
    font-weight: 700;
    color: #ff6b35;
}

.schedule-row .schedule-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.schedule-row .schedule-status.success {
    color: #07C160;
    background: rgba(7, 193, 96, 0.1);
}

.schedule-row .schedule-status.pending {
    color: #ff9500;
    background: rgba(255, 149, 0, 0.1);
}

/* 响应式适配 */
@media (max-width: 375px) {
    .stats-value {
        font-size: 24px;
    }
    
    .order-phone {
        font-size: 16px;
    }
    
    .amount-value {
        font-size: 18px;
    }
}

/* 取消订单确认对话框 */
.delete-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.delete-dialog-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 280px;
    text-align: center;
    z-index: 1001;
    animation: dialogScale 0.2s ease;
}

@keyframes dialogScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.delete-dialog-icon {
    margin-bottom: 16px;
}

.delete-dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.delete-dialog-text {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.delete-dialog-buttons {
    display: flex;
    gap: 12px;
}

.delete-dialog-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.delete-dialog-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.delete-dialog-btn-cancel:active {
    background: #e8e8e8;
}

.delete-dialog-btn-confirm {
    background: linear-gradient(135deg, #ff3366 0%, #ff6b9d 100%);
    color: #ffffff;
}

.delete-dialog-btn-confirm:active {
    opacity: 0.9;
}
