html,
body {
    width: 100%;
    min-height: 100%;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #1f2937;
    background: #eef4f8;
    font-family: "PingFang SC", "Microsoft Yahei", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.shop-page {
    min-height: 100vh;
    padding: 28px 16px;
}

.shop-shell {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.shop-header h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0;
}

.shop-header p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 15px;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 94px;
    height: 38px;
    border: 1px solid #ccd6e0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 14px;
}

.shop-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.panel {
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 18px;
    border-bottom: 1px solid #e6edf3;
    font-size: 17px;
    font-weight: 700;
}

.panel-title strong {
    color: #0f766e;
    font-size: 18px;
}

form {
    margin: 0;
}

.buy-panel form {
    padding: 18px;
}

.field {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 12px;
    color: #111827;
    background: #fff;
    font-size: 16px;
    outline: none;
}

input:focus,
select:focus {
    border-color: #138a7e;
    box-shadow: 0 0 0 3px rgba(19, 138, 126, .12);
}

.quantity-row {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 22px;
    line-height: 1;
}

.summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 16px;
    padding: 14px;
    border-radius: 6px;
    background: #f1f5f9;
}

.summary strong {
    color: #b45309;
    font-size: 24px;
}

.primary-btn,
.secondary-btn {
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.primary-btn {
    width: 100%;
    height: 46px;
    background: #138a7e;
}

.secondary-btn {
    width: 110px;
    height: 44px;
    background: #315a89;
}

.primary-btn:disabled {
    background: #94a3b8;
}

.query-panel {
    min-height: 260px;
}

.query-form {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 10px;
    padding: 18px;
    border-bottom: 1px solid #e6edf3;
}

.message {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.message.info,
.message.ok,
.message.err {
    display: block;
}

.message.info {
    color: #315a89;
    background: #dbeafe;
}

.message.ok {
    color: #047857;
    background: #d1fae5;
}

.message.err {
    color: #b91c1c;
    background: #fee2e2;
}

.order-list {
    padding: 16px 18px 18px;
}

.empty {
    padding: 28px 0;
    color: #64748b;
    text-align: center;
}

.order-item {
    padding: 14px 0;
    border-bottom: 1px solid #edf2f7;
}

.order-item:last-child {
    border-bottom: 0;
}

.order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.order-head strong {
    font-size: 14px;
    word-break: break-all;
}

.order-status {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.order-status.paid {
    color: #047857;
    background: #d1fae5;
}

.order-status.pending {
    color: #0f4c81;
    background: #dbeafe;
}

.order-meta {
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}

.muted {
    color: #94a3b8;
    font-size: 13px;
}

.section-label {
    margin-bottom: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.order-code-block {
    margin-top: 12px;
}

.activation-code-list {
    display: grid;
    gap: 8px;
}

.activation-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #d7eadf;
    border-radius: 6px;
    background: #fbfefc;
}

.activation-code-main {
    min-width: 0;
}

.activation-code-main span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px;
}

.activation-code-main strong {
    display: block;
    color: #14532d;
    font-family: Consolas, "Courier New", monospace;
    font-size: 18px;
    letter-spacing: 0;
    word-break: break-all;
}

.code-copy {
    width: 70px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: #138a7e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.code-placeholder {
    margin-top: 10px;
    padding: 11px 12px;
    border-radius: 6px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 13px;
}

.pay-result {
    margin-top: 12px;
}

.pay-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
}

.pay-card-mobile {
    justify-items: stretch;
}

.pay-card-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #14532d;
}

.pay-card-success .pay-card-head span {
    color: #166534;
}

.result-card {
    justify-items: stretch;
    text-align: left;
}

.result-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
}

.result-title {
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
}

.result-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px solid #d7eadf;
    border-radius: 6px;
    background: #fff;
}

.result-summary div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.result-summary span {
    color: #64748b;
    font-size: 13px;
}

.result-summary strong {
    color: #1f2937;
    font-size: 13px;
    word-break: break-all;
}

.result-code-panel {
    width: 100%;
    padding: 12px;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #fff;
}

.pay-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.pay-card-head strong {
    font-size: 17px;
}

.pay-card-head span {
    color: #b45309;
    font-size: 20px;
    font-weight: 800;
}

.wechat-qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 238px;
    min-height: 238px;
    padding: 8px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #fff;
}

.wechat-qrcode img,
.wechat-qrcode canvas {
    display: block;
    width: 220px;
    height: 220px;
}

.mobile-pay-brief {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #fff;
}

.mobile-pay-brief strong {
    color: #0f172a;
    font-size: 18px;
}

.mobile-pay-brief span {
    color: #64748b;
    font-size: 14px;
}

.qr-backup {
    width: 100%;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #fff;
}

.qr-backup summary {
    cursor: pointer;
    padding: 12px;
    color: #315a89;
    font-size: 14px;
    font-weight: 700;
}

.qr-backup .wechat-qrcode {
    margin: 0 auto 12px;
}

.pay-card p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    text-align: center;
}

.pay-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.pay-actions.single-action {
    grid-template-columns: 1fr;
}

.pay-open,
.pay-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.pay-open {
    cursor: pointer;
}

.pay-copy.copied,
.code-copy.copied {
    background: #047857;
}

.qr-fallback {
    padding: 20px;
    color: #b91c1c;
    text-align: center;
}

@media (max-width: 760px) {
    .shop-page {
        padding: 18px 12px;
    }

    .shop-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .shop-header h1 {
        font-size: 26px;
    }

    .shop-grid {
        grid-template-columns: 1fr;
    }

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

    .secondary-btn {
        width: 100%;
    }

    .pay-actions {
        grid-template-columns: 1fr;
    }

    .activation-code-row {
        grid-template-columns: 1fr;
    }

    .code-copy {
        width: 100%;
    }
}
