/**
 * 半糖书屋 - 订单记录页面「书斋雅集」设计
 * 灵感：账簿与典籍记录
 */

/* ========================================
   页面容器
   ======================================== */
.orders-page {
    padding: 24px;
    background: linear-gradient(180deg, var(--paper-cream, #f9f5ef) 0%, var(--background-color, #faf8f5) 100%);
    min-height: 100vh;
}

/* ========================================
   页面头部
   ======================================== */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark, #3d2e1f);
}

.page-header h1 i {
    font-size: 28px;
    color: var(--primary-color, #c48b4a);
}

/* ========================================
   筛选区域
   ======================================== */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white, #fff);
    border: 1px solid var(--border-color, rgba(210, 180, 140, 0.3));
    border-radius: var(--radius, 12px);
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(139, 90, 43, 0.06);
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #5a4a3a);
    background: var(--paper-cream, #f9f5ef);
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: #fff8ee;
    border-color: rgba(212, 162, 76, 0.3);
}

.filter-tab.active {
    color: var(--white, #fff);
    background: linear-gradient(135deg, var(--primary-color, #c48b4a) 0%, var(--primary-dark, #8b5a2b) 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(196, 139, 74, 0.3);
}

.filter-type select {
    padding: 10px 36px 10px 16px;
    font-size: 14px;
    color: var(--text-color, #5a4a3a);
    background: var(--paper-cream, #f9f5ef) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%235a4a3a' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--border-color, rgba(210, 180, 140, 0.3));
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.filter-type select:hover {
    border-color: var(--primary-color, #c48b4a);
}

.filter-type select:focus {
    outline: none;
    border-color: var(--primary-color, #c48b4a);
    box-shadow: 0 0 0 3px rgba(196, 139, 74, 0.1);
}

/* ========================================
   订单列表
   ======================================== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========================================
   订单卡片 - 账簿风格
   ======================================== */
.order-card {
    position: relative;
    background: var(--white, #fff);
    border: 1px solid var(--border-color, rgba(210, 180, 140, 0.3));
    border-radius: var(--radius, 12px);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(139, 90, 43, 0.06);
}

.order-card:hover {
    border-color: rgba(212, 162, 76, 0.4);
    box-shadow: 0 8px 32px rgba(139, 90, 43, 0.1);
    transform: translateY(-2px);
}

/* 左侧装饰条 */
.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color, #c48b4a) 0%, var(--primary-dark, #8b5a2b) 100%);
}

.order-card.pending::before {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.order-card.cancelled::before {
    background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
}

.order-card.refunded::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--paper-cream, #f9f5ef) 0%, #fff 100%);
    border-bottom: 1px dashed var(--border-color, rgba(210, 180, 140, 0.3));
}

.order-no {
    font-size: 13px;
    color: var(--text-light, #a99a8a);
}

.order-no span {
    font-weight: 600;
    color: var(--text-color, #5a4a3a);
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.order-status.paid {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.order-status.pending {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

.order-status.cancelled {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
}

.order-status.refunded {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.order-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.order-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.order-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(212, 162, 76, 0.15) 0%, rgba(196, 139, 74, 0.1) 100%);
    border: 1px solid rgba(212, 162, 76, 0.2);
    border-radius: 50%;
}

.order-icon i {
    font-size: 22px;
    color: var(--primary-color, #c48b4a);
}

.order-icon.vip i {
    color: #ffd700;
}

.order-icon.coin i {
    color: var(--primary-color, #c48b4a);
}

.order-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark, #3d2e1f);
    margin-bottom: 6px;
}

.order-details p {
    font-size: 13px;
    color: var(--text-light, #a99a8a);
}

.order-amount {
    text-align: right;
}

.order-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color, #c48b4a);
}

.order-time {
    font-size: 12px;
    color: var(--text-light, #a99a8a);
    margin-top: 4px;
}

.order-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 20px;
    background: var(--paper-cream, #f9f5ef);
    border-top: 1px solid var(--border-color, rgba(210, 180, 140, 0.3));
}

.btn-order-action {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-order-action.primary {
    color: var(--white, #fff);
    background: linear-gradient(135deg, var(--primary-color, #c48b4a) 0%, var(--primary-dark, #8b5a2b) 100%);
    border: none;
}

.btn-order-action.primary:hover {
    box-shadow: 0 4px 12px rgba(196, 139, 74, 0.3);
}

.btn-order-action.secondary {
    color: var(--text-color, #5a4a3a);
    background: var(--white, #fff);
    border: 1px solid var(--border-color, rgba(210, 180, 140, 0.3));
}

.btn-order-action.secondary:hover {
    border-color: var(--primary-color, #c48b4a);
    color: var(--primary-color, #c48b4a);
}

/* ========================================
   分页
   ======================================== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 32px;
    padding: 20px;
}

.btn-page {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #5a4a3a);
    background: var(--white, #fff);
    border: 1px solid var(--border-color, rgba(210, 180, 140, 0.3));
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-page:hover:not(:disabled) {
    border-color: var(--primary-color, #c48b4a);
    color: var(--primary-color, #c48b4a);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: var(--text-light, #a99a8a);
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 64px;
    color: var(--border-color, rgba(210, 180, 140, 0.5));
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-light, #a99a8a);
    margin-bottom: 24px;
}

.empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    color: var(--white, #fff);
    background: linear-gradient(135deg, var(--primary-color, #c48b4a) 0%, var(--primary-dark, #8b5a2b) 100%);
    border: none;
    border-radius: var(--radius, 12px);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(196, 139, 74, 0.3);
}

.empty-state .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 139, 74, 0.4);
}

/* ========================================
   加载占位
   ======================================== */
.loading-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light, #a99a8a);
    font-size: 14px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .orders-page {
        padding: 16px;
    }

    .filter-section {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .filter-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .filter-tabs::-webkit-scrollbar-track {
        background: var(--paper-cream, #f9f5ef);
        border-radius: 2px;
    }

    .filter-tabs::-webkit-scrollbar-thumb {
        background: var(--border-color, rgba(210, 180, 140, 0.5));
        border-radius: 2px;
    }

    .filter-type {
        width: 100%;
    }

    .filter-type select {
        width: 100%;
    }

    .order-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .order-amount {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 16px;
        border-top: 1px dashed var(--border-color, rgba(210, 180, 140, 0.3));
    }

    .order-footer {
        justify-content: center;
    }

    .btn-order-action {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 20px;
    }

    .filter-tab {
        padding: 8px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .order-info {
        gap: 12px;
    }

    .order-icon {
        width: 44px;
        height: 44px;
    }

    .order-icon i {
        font-size: 18px;
    }

    .order-details h4 {
        font-size: 14px;
    }

    .order-price {
        font-size: 18px;
    }
}
