/* 我的订单 - 与 addons/membership/settings 风格一致 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #1f2937;
}

/* 头部 - 与 addons/membership/settings 保持一致 */
.page-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 0 24px 0;
}
.page-header .header-left { display: flex; align-items: center; gap: 16px; }
.page-header .back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.page-header .back-btn:hover { background: rgba(255, 255, 255, 0.3); }
.page-header .page-title { font-size: 20px; font-weight: 600; margin: 0; color: white; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px 24px; box-sizing: border-box; }

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tab {
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.15s;
}
.tab.active { background: #2563eb; color: white; }

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: #f9fafb; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f3f4f6; }
th { font-weight: 500; color: #6b7280; font-size: 12px; text-transform: uppercase; }
tbody tr:hover { background: #f9fafb; }

.order-no { font-family: monospace; font-size: 12px; color: #6b7280; }
.amount { color: #dc2626; font-weight: 600; }

.status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.status.pending { background: #fef3c7; color: #92400e; }
.status.paid,
.status.completed { background: #d1fae5; color: #065f46; }
.status.cancelled,
.status.expired { background: #f3f4f6; color: #6b7280; }
.status.refunded { background: #fee2e2; color: #991b1b; }
.status.fulfill_failed { background: #fee2e2; color: #991b1b; }

.btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    cursor: pointer;
    margin-right: 4px;
}
.btn:hover { background: #f9fafb; border-color: #9ca3af; }
.btn.primary { background: #2563eb; color: white; border-color: #2563eb; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: #dc2626; }
.btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }

.empty {
    padding: 64px 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}
.pagination button {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    cursor: pointer;
}
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination button.active { background: #2563eb; color: white; border-color: #2563eb; }

.loading { text-align: center; padding: 40px; color: #9ca3af; }

/* 申请开票弹窗内的表单 */
.invoice-form { text-align: left; }
.invoice-form .row { margin-bottom: 12px; }
.invoice-form label {
    display: block;
    font-size: 13px;
    color: #374151;
    margin-bottom: 4px;
    font-weight: 500;
}
.invoice-form .required::after { content: ' *'; color: #dc2626; }
.invoice-form input,
.invoice-form select,
.invoice-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}
.invoice-form input:focus,
.invoice-form select:focus,
.invoice-form textarea:focus { outline: none; border-color: #2563eb; }
.invoice-form .group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.invoice-form .hint { font-size: 11px; color: #9ca3af; margin-top: 3px; }

/* 移动端：表格转卡片 */
@media (max-width: 768px) {
    .page-header { padding: 12px 16px; }
    .page-header .page-title { font-size: 17px; }
    .container { padding: 0 12px 20px; }

    .tabs { width: 100%; }
    .tab { flex: 1; text-align: center; padding: 10px 12px; }

    .card { background: transparent; box-shadow: none; overflow: visible; }
    table, thead, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tbody tr {
        background: #fff;
        border-radius: 10px;
        padding: 12px 14px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }
    tbody tr:hover { background: #fff; }
    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px dashed #f3f4f6;
        text-align: right;
    }
    tbody td:last-child { border-bottom: none; padding-top: 10px; }
    tbody td::before {
        content: attr(data-label);
        color: #6b7280;
        font-size: 13px;
        font-weight: 500;
        flex-shrink: 0;
        text-align: left;
    }
    tbody td > * { text-align: right; }

    .btn { padding: 8px 14px; font-size: 13px; margin-right: 0; margin-left: 6px; }
    .order-no { word-break: break-all; }

    .invoice-form .group { grid-template-columns: 1fr; }
}
