/* ===== 我的订单 ===== */

.orders-page {
    background: #FFF0F5;
}

.orders-page nav a.active {
    color: #c2185b;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.orders-user {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 2px solid #4d22d5;
    background: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: bold;
}

.orders-main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 48px 5% 80px;
}

.orders-head {
    margin-bottom: 24px;
}

.orders-head h1 {
    margin: 4px 0 8px;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.25;
    color: #4d22d5;
}

.orders-sub {
    font-size: 14px;
    color: #7a5cd6;
}

.mode-banner {
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 2px solid #4d22d5;
    background: #e9e4ff;
    color: #4d22d5;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 4px 4px 0 rgba(77, 34, 213, 0.25);
}

.orders-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 3px solid #4d22d5;
    background: #fff8fe;
    box-shadow: 5px 5px 0 #4d22d5;
}

.summary-card span {
    font-size: 12px;
    color: #7a5cd6;
}

.summary-card strong {
    font-size: 24px;
    line-height: 1.2;
    color: #4d22d5;
}

.orders-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 3px solid #4d22d5;
    padding-bottom: 12px;
}

.orders-tab {
    padding: 8px 16px;
    border: 2px solid #4d22d5;
    background: #fff8fe;
    color: #4d22d5;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.orders-tab:hover {
    background: #f1d3f2;
}

.orders-tab.is-active {
    background: #4d22d5;
    color: #fff8fe;
}

.orders-refresh {
    margin-left: auto;
    padding: 8px 12px;
    border: 2px dashed #4d22d5;
    background: transparent;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.orders-refresh:hover {
    background: #f1d3f2;
}

.orders-list {
    display: grid;
    gap: 14px;
}

.order-card {
    border: 3px solid #4d22d5;
    background: #fff8fe;
    box-shadow: 5px 5px 0 #4d22d5;
    padding: 16px 18px;
}

.order-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(77, 34, 213, 0.3);
}

.order-type {
    padding: 2px 8px;
    border: 1px solid #4d22d5;
    background: #f1d3f2;
    font-size: 11px;
    font-weight: bold;
}

.order-type.purchase {
    background: #e6f4ff;
    border-color: #2b6ca3;
    color: #2b6ca3;
}

.order-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: bold;
}

.order-status.paid,
.order-status.completed {
    color: #1f7a45;
}

.order-status.pending {
    color: #a76b00;
}

.order-status.submitted {
    color: #a76b00;
}

.order-status.rejected {
    color: #c2185b;
}

.order-status.expired {
    color: #8a8a8a;
}

.order-card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-top: 12px;
}

.order-main {
    min-width: 0;
}

.order-amount {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.3;
    color: #4d22d5;
}

.order-coins {
    margin-top: 2px;
    font-size: 12px;
    color: #7a5cd6;
}

.order-items {
    margin-top: 6px;
    font-size: 12px;
    color: #7a5cd6;
}

.order-meta {
    flex-shrink: 0;
    max-width: 55%;
    font-size: 11px;
    color: #7a5cd6;
    text-align: right;
    line-height: 1.9;
}

.order-meta code {
    display: inline-block;
    max-width: 100%;
    padding: 1px 5px;
    background: #f1d3f2;
    color: #4d22d5;
    font-size: 11px;
    word-break: break-all;
}

.copy-order {
    margin-left: 6px;
    padding: 1px 7px;
    border: 1px solid #4d22d5;
    background: transparent;
    color: #4d22d5;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
}

.copy-order:hover {
    background: #f1d3f2;
}

.order-message-btn {
    margin-top: 6px;
    padding: 4px 10px;
    border: 2px solid #4d22d5;
    background: #f1d3f2;
    color: #4d22d5;
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

.order-message-btn:hover {
    background: #e8c0e9;
}

.message-overlay {
    position: fixed;
    inset: 0;
    z-index: 750;
    background: rgba(77, 34, 213, 0.35);
}

.message-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 760;
    display: flex;
    flex-direction: column;
    width: min(520px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 80px));
    transform: translate(-50%, -50%);
    border: 3px solid #4d22d5;
    background: #fff8fe;
    box-shadow: 6px 6px 0 #4d22d5;
}

.message-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 2px solid #4d22d5;
    background: #f1d3f2;
}

.message-head h2 {
    font-size: 18px;
}

.message-order {
    margin-top: 2px;
    font-size: 10px;
    color: #7a5cd6;
    word-break: break-all;
}

.message-head button {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 2px solid #4d22d5;
    background: #fff8fe;
    color: #4d22d5;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.message-list {
    flex: 1;
    min-height: 0;
    display: grid;
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
}

.message-item {
    padding: 10px 12px;
    border: 2px solid #b9a8e8;
    background: #ffffff;
}

.message-item.from-admin {
    border-color: #4d22d5;
    background: #f1d3f2;
}

.message-item.from-user {
    border-color: #c2185b;
    background: #ffe3ef;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 10px;
    color: #7a5cd6;
}

.message-item p {
    font-size: 12px;
    line-height: 1.7;
    word-break: break-word;
}

.message-empty {
    padding: 28px 12px;
    text-align: center;
    font-size: 13px;
    color: #7a5cd6;
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 2px solid #4d22d5;
    background: #fff8fe;
}

.message-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #4d22d5;
    background: #ffffff;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.6;
    outline: none;
    resize: vertical;
}

.message-form button {
    align-self: flex-end;
    padding: 8px 16px;
    border: 2px solid #4d22d5;
    background: #f1d3f2;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.message-form button:hover {
    background: #e8c0e9;
}

.orders-empty {
    padding: 48px 20px;
    border: 3px dashed #4d22d5;
    background: #fff8fe;
    text-align: center;
    color: #7a5cd6;
}

.orders-empty p {
    margin-bottom: 14px;
    font-size: 14px;
}

.orders-empty a {
    color: #c2185b;
    font-weight: bold;
    text-decoration: none;
}

.orders-empty a:hover {
    text-decoration: underline;
}

/* ===== 客服问答 ===== */

.support-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 700;
    padding: 12px 18px;
    border: 3px solid #4d22d5;
    background: #f1d3f2;
    color: #4d22d5;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 4px 4px 0 #4d22d5;
}

.support-toggle:hover {
    background: #e8c0e9;
}

.support-panel {
    position: fixed;
    right: 24px;
    bottom: 82px;
    z-index: 700;
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 32px));
    height: min(520px, calc(100vh - 120px));
    border: 3px solid #4d22d5;
    background: #fff8fe;
    box-shadow: 6px 6px 0 #4d22d5;
}

.support-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 2px solid #4d22d5;
    background: #f1d3f2;
}

.support-head strong {
    display: block;
    font-size: 14px;
}

.support-head small {
    display: block;
    font-size: 10px;
    color: #7a5cd6;
}

.support-head button {
    width: 28px;
    height: 28px;
    border: 2px solid #4d22d5;
    background: #fff8fe;
    color: #4d22d5;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.support-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
}

.support-msg {
    max-width: 86%;
    padding: 9px 12px;
    border: 2px solid #4d22d5;
    font-size: 12px;
    line-height: 1.7;
    word-break: break-word;
}

.support-msg.bot {
    align-self: flex-start;
    background: #ffffff;
    border-color: #b9a8e8;
}

.support-msg.user {
    align-self: flex-end;
    background: #f1d3f2;
}

.support-msg.typing {
    color: #7a5cd6;
    font-style: italic;
}

.support-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
}

.support-chip {
    padding: 4px 9px;
    border: 1px solid #4d22d5;
    background: #fff8fe;
    color: #4d22d5;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
}

.support-chip:hover {
    background: #f1d3f2;
}

.support-form {
    display: flex;
    gap: 8px;
    padding: 10px 14px 14px;
    border-top: 2px solid #4d22d5;
}

.support-form input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 2px solid #4d22d5;
    background: #ffffff;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.support-form input::placeholder {
    color: rgba(77, 34, 213, 0.45);
}

.support-form button {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 2px solid #4d22d5;
    background: #f1d3f2;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.support-form button:hover {
    background: #e8c0e9;
}

.orders-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 800;
    max-width: 90vw;
    padding: 10px 18px;
    transform: translateX(-50%);
    border: 2px solid #4d22d5;
    background: #4d22d5;
    color: #fff8fe;
    font-size: 12px;
    font-weight: bold;
}

@media (max-width: 720px) {
    .orders-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .orders-tabs {
        flex-wrap: wrap;
    }

    .orders-refresh {
        margin-left: 0;
    }

    .order-card-body {
        flex-direction: column;
        gap: 10px;
    }

    .order-meta {
        max-width: 100%;
        text-align: left;
    }

    .support-toggle {
        right: 14px;
        bottom: 14px;
    }

    .support-panel {
        right: 16px;
        bottom: 70px;
        width: calc(100vw - 32px);
    }
}

@media (max-width: 520px) {
    .orders-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .orders-main {
        padding: 32px 4% 70px;
    }

    .orders-user {
        display: none;
    }
}
