* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f4f5f7;
}

body {
    min-height: 100%;
    margin: 0;
    color: #1f2328;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    font-size: 16px;
    letter-spacing: 0;
}

button,
input,
textarea {
    font: inherit;
    letter-spacing: 0;
}

.redeem-shell {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.redeem-heading {
    margin: 0 6px 28px;
}

.redeem-heading span {
    display: block;
    color: #0875e1;
    font-weight: 800;
    margin-bottom: 10px;
}

.redeem-heading h1 {
    margin: 0;
    font-size: clamp(42px, 6vw, 64px);
    line-height: 1.1;
    font-weight: 900;
}

.redeem-heading p {
    margin: 16px 0 0;
    color: #66707f;
    font-size: 20px;
}

.redeem-panel {
    margin-top: 18px;
    padding: 22px;
    background: #fff;
    border: 1px solid #e8ebef;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(31, 35, 40, .08);
}

.redeem-panel h2 {
    margin: 0 0 18px;
    font-size: 20px;
    line-height: 1.25;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

label {
    display: block;
    margin: 0 0 10px;
    color: #414953;
    font-weight: 800;
}

.batch-label {
    margin-top: 28px;
}

.inline-control {
    display: grid;
    grid-template-columns: 1fr 108px;
    gap: 12px;
}

input,
textarea,
.result-box,
.notice,
.batch-result {
    width: 100%;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    background: #f7f8fa;
}

input,
textarea {
    color: #1f2328;
    outline: none;
}

input {
    min-height: 60px;
    padding: 0 18px;
    font-size: 18px;
}

textarea {
    display: block;
    min-height: 152px;
    padding: 18px;
    resize: vertical;
    line-height: 1.65;
}

input:focus,
textarea:focus {
    border-color: #0875e1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 117, 225, .12);
}

button {
    min-height: 60px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
}

button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.primary {
    color: #fff;
    background: #0875e1;
}

.primary:hover:not(:disabled),
.submit:hover:not(:disabled) {
    background: #0564bf;
}

.submit {
    width: 100%;
    color: #fff;
    background: #33383f;
}

.secondary,
.ghost {
    color: #1f2328;
    background: #eceef2;
}

.secondary:hover:not(:disabled),
.ghost:hover:not(:disabled) {
    background: #dde2e9;
}

.ghost {
    min-height: 34px;
    padding: 0;
    color: #0875e1;
    background: transparent;
}

.full {
    width: 100%;
    margin-top: 14px;
}

.result-box,
.notice,
.batch-result {
    min-height: 58px;
    margin-top: 16px;
    padding: 16px 18px;
    color: #747c88;
    line-height: 1.55;
}

.notice {
    color: #8a5a00;
    background: #fff7dc;
    border-color: #f2df9c;
}

.result-box.ok,
.notice.ok {
    color: #14643a;
    background: #ebfff4;
    border-color: #b9ebcc;
}

.result-box.bad,
.notice.bad {
    color: #9d1c1c;
    background: #fff0f0;
    border-color: #f2b8b8;
}

.result-box.warn,
.notice.warn {
    color: #8a5a00;
    background: #fff7dc;
    border-color: #f2df9c;
}

.is-hidden {
    display: none;
}

.page-hidden {
    display: none;
}

@keyframes rechargePulse {
    0% {
        transform: scale(.75);
        opacity: .45;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(.75);
        opacity: .45;
    }
}

.action-panel {
    display: grid;
    gap: 16px;
}

.wait-page {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.wait-page.page-hidden {
    display: none;
}

.wait-status-dot {
    width: 18px;
    height: 18px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: #8a5a00;
    box-shadow: 0 0 0 10px rgba(138, 90, 0, .1);
    animation: rechargePulse 1.3s ease-in-out infinite;
}

.wait-page.ok .wait-status-dot {
    background: #14643a;
    box-shadow: 0 0 0 10px rgba(20, 100, 58, .1);
    animation: none;
}

.wait-page.bad .wait-status-dot {
    background: #9d1c1c;
    box-shadow: 0 0 0 10px rgba(157, 28, 28, .1);
    animation: none;
}

.wait-page > span {
    color: #0875e1;
    font-weight: 900;
    margin-bottom: 10px;
}

.wait-page h2 {
    margin: 0;
    font-size: 42px;
    line-height: 1.18;
}

.wait-page p {
    margin: 16px 0 0;
    color: #66707f;
    font-size: 18px;
}

.wait-meta {
    width: 100%;
    margin-top: 24px;
    padding: 16px 18px;
    color: #414953;
    line-height: 1.8;
    background: #f7f8fa;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
}

.countdown-card {
    width: 100%;
    margin-top: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #8a5a00;
    background: #fff7dc;
    border: 1px solid #f2df9c;
    border-radius: 8px;
}

.countdown-card strong {
    min-width: 42px;
    font-size: 34px;
    line-height: 1;
    color: #1f2328;
}

.countdown-card.done {
    color: #14643a;
    background: #ebfff4;
    border-color: #b9ebcc;
}

.batch-result {
    display: none;
    overflow: hidden;
    padding: 0;
    background: #fff;
}

.batch-result.visible {
    display: block;
}

.batch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px minmax(180px, 1.2fr);
    gap: 12px;
    padding: 13px 16px;
    border-top: 1px solid #eef1f4;
    align-items: center;
}

.batch-row:first-child {
    border-top: 0;
}

.batch-code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.batch-state {
    font-weight: 900;
}

.batch-state.ok {
    color: #147947;
}

.batch-state.bad {
    color: #a61d24;
}

.batch-state.warn {
    color: #9b6500;
}

.batch-message {
    color: #66707f;
}

@media (max-width: 700px) {
    .redeem-shell {
        width: min(100% - 24px, 920px);
        padding-top: 28px;
    }

    .redeem-heading h1 {
        font-size: 42px;
    }

    .redeem-heading p {
        font-size: 17px;
    }

    .redeem-panel {
        padding: 18px;
    }

    .wait-page h2 {
        font-size: 32px;
    }

    .inline-control {
        grid-template-columns: 1fr;
    }

    .batch-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
