:root {
    --bg: #f6f5f2;
    --panel: #ffffff;
    --text: #202124;
    --muted: #6b6f76;
    --line: #e6e0d8;
    --accent: #f4c542;
    --accent-dark: #222222;
    --ok: #25895c;
    --warn: #c97712;
    --bad: #c44242;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(244, 197, 66, 0.22), transparent 38%),
        linear-gradient(225deg, rgba(47, 115, 181, 0.14), transparent 34%),
        var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.checkout {
    width: min(520px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(37, 34, 29, 0.12);
    padding: 28px;
}

.brand-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    color: #1f1b12;
    font-size: 24px;
    font-weight: 800;
}

h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.25;
    letter-spacing: 0;
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.product {
    margin-top: 28px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfaf8;
}

.label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 13px;
}

.pill {
    flex: none;
    padding: 5px 10px;
    border-radius: 999px;
    background: #edf4ef;
    color: #256145;
    font-size: 12px;
    font-weight: 700;
}

.order-box {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #ead28c;
    border-radius: 8px;
    background: #fff8df;
}

.order-no {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0;
}

.hint {
    margin-top: 10px;
    color: #7b6123;
}

.actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-top: 18px;
}

button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.primary {
    background: var(--accent-dark);
    color: #ffffff;
}

.secondary {
    background: #ece9e3;
    color: #252525;
}

.small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

.status-line {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warn);
}

.dot.paid {
    background: var(--ok);
}

.dot.failed {
    background: var(--bad);
}

.debug {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

summary {
    cursor: pointer;
    color: var(--muted);
}

.debug-body {
    margin-top: 12px;
    display: grid;
    gap: 12px;
}

code,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
    max-height: 220px;
    overflow: auto;
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: #24211d;
    color: #fff7e8;
    font-size: 12px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
    pointer-events: none;
    padding: 11px 14px;
    border-radius: 8px;
    background: #202124;
    color: #ffffff;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
    .shell {
        padding: 14px;
        place-items: stretch;
    }

    .checkout {
        margin: auto 0;
        padding: 20px;
    }

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