:root {
    --page: #f3f3f3;
    --surface: #fff;
    --ink: #1c1f24;
    --muted: #7c828b;
    --line: #d8dce2;
    --yellow: #ffe100;
    --yellow-dark: #f2d500;
    --green: #19a75a;
    --green-soft: #edf9f2;
    --red: #df514b;
    --font: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: #e6e6e6; font-family: var(--font); color: var(--ink); }
body { margin: 0; min-height: 100vh; letter-spacing: 0; }
body.modal-open { overflow: hidden; }
button, input { font: inherit; letter-spacing: 0; }
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 20; padding: 8px 12px; background: #000; color: #fff; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid rgba(28,31,36,.22); outline-offset: 2px; }

.mobile-page { width: min(100%, 480px); min-height: 100vh; margin: 0 auto; background: var(--page); }
.reward-head { padding: 24px 20px 60px; color: var(--ink); text-align: center; background: var(--yellow); }
.reward-head h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.reward-head p { margin: 8px 0 0; color: #665b00; font-size: 13px; }

.claim-form { width: calc(100% - 24px); margin: -36px 12px 0; padding: 26px 20px 28px; background: var(--surface); border-radius: 8px 8px 0 0; }
.order-line { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 22px; padding: 12px 14px; background: #f7f7f7; border-left: 4px solid var(--yellow); font-size: 14px; }
.order-line span { color: var(--muted); }
.order-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-group { margin-bottom: 22px; }
.field-group > label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 700; }
.field-group > label span { margin-left: 2px; color: var(--red); }
.field-group > label em { margin-left: 8px; color: var(--red); font-size: 14px; font-style: normal; font-weight: 500; }
.field-group input:not([type="file"]) { width: 100%; height: 52px; padding: 0 14px; color: var(--ink); background: #fff; border: 1px solid #c9ced5; border-radius: 6px; font-size: 16px; }
.field-group input::placeholder { color: #afb4bb; }
.field-group input:focus { border-color: #c7ad00; box-shadow: 0 0 0 3px rgba(255,225,0,.25); outline: none; }
.field-warning { margin: -2px 0 10px; color: var(--red); font-size: 13px; line-height: 1.6; }

.upload-box { position: relative; width: 100%; height: 150px; display: grid; place-items: center; margin: 0 auto; padding: 0; overflow: hidden; color: inherit; background: #fffdf0; border: 1px dashed #bca700; border-radius: 6px; cursor: pointer; }
.file-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.upload-box img { position: absolute; inset: 6px; display: block; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; object-position: center; background: #f1f2f4; }
.upload-box img[hidden], .upload-prompt[hidden] { display: none; }
.upload-prompt { display: grid; justify-items: center; gap: 3px; padding: 22px; color: #766800; }
.upload-prompt b { font-size: 30px; line-height: 1; font-weight: 400; }
.upload-prompt strong { font-size: 15px; }
.ocr-state { min-height: 25px; padding: 8px 2px 0; color: var(--muted); font-size: 12px; }
.ocr-state[data-tone="loading"] { color: #806f00; }
.ocr-state[data-tone="success"] { color: var(--green); }
.ocr-state[data-tone="warning"] { color: #9b650d; }
.ocr-state[data-tone="error"] { color: var(--red); }

.consent-row { display: flex; gap: 7px; align-items: flex-start; margin: 0 0 18px; }
.consent-row input { flex: none; width: 14px; height: 14px; margin: 3px 0 0; accent-color: #1c1f24; }
.consent-row label { color: var(--muted); font-size: 12px; line-height: 1.7; }
.agreement-link { display: inline; margin: 0; padding: 0; color: #6f6100; background: transparent; border: 0; text-decoration: underline; cursor: pointer; }
.claim-button { width: 100%; min-height: 54px; color: var(--ink); background: var(--yellow); border: 0; border-radius: 6px; font-size: 18px; font-weight: 800; cursor: pointer; }
.claim-button:hover { background: var(--yellow-dark); }
.claim-button:disabled { opacity: .65; cursor: wait; }
.arrival-note { margin: 14px 0 0; color: var(--muted); text-align: center; font-size: 13px; }

.state-page { display: grid; place-items: center; padding: 28px 18px; }
.state-box { width: 100%; padding: 42px 24px; background: #fff; border-radius: 8px; text-align: center; }
.state-box h1 { margin: 16px 0 6px; font-size: 24px; }
.state-box > p:not(.arrival-note) { margin: 0; color: var(--muted); }
.authorize-box { padding-top: 38px; }
.authorize-mark { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto; color: var(--ink); background: var(--yellow); border-radius: 50%; }
.authorize-mark svg { width: 34px; height: 34px; stroke-width: 1.8; }
.authorize-order { display: flex; justify-content: space-between; gap: 14px; margin: 28px 0 20px; padding: 12px 14px; color: var(--muted); background: #f7f7f7; border-left: 4px solid var(--yellow); text-align: left; font-size: 14px; }
.authorize-order strong { min-width: 0; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.authorize-button { display: grid; place-items: center; width: 100%; min-height: 52px; color: var(--ink); background: var(--yellow); border-radius: 6px; font-size: 17px; font-weight: 800; text-decoration: none; }
.authorize-button:hover { background: var(--yellow-dark); }
.authorize-note { margin-top: 14px !important; font-size: 12px; line-height: 1.7; }
.result-mark, .invalid-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto; color: var(--ink); border-radius: 50%; font-size: 26px; font-weight: 800; }
.result-mark { background: var(--yellow); }
.member-icon { width: 30px; height: 30px; stroke-width: 2; }
.result-approved .result-mark, .result-completed .result-mark { color: #fff; background: var(--green); }
.result-rejected .result-mark { color: #fff; background: var(--red); }
.invalid-mark { color: #fff; background: var(--red); }
.state-box dl { margin: 28px 0 20px; border-top: 1px solid var(--line); }
.state-box dl div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.state-box dt { color: var(--muted); }
.state-box dd { margin: 0; font-weight: 700; }
.edit-submission { display: grid; place-items: center; width: 100%; min-height: 48px; margin-top: 20px; color: var(--ink); background: var(--yellow); border-radius: 6px; font-weight: 800; text-decoration: none; }
.edit-submission:hover { background: var(--yellow-dark); }

.policy-page { padding: 16px; }
.policy-page article { padding: 26px 22px; background: #fff; border-radius: 8px; }
.policy-page h1 { margin: 0 0 26px; font-size: 22px; }
.policy-page h2 { margin: 24px 0 6px; font-size: 16px; }
.policy-page p { margin: 0; color: #606874; font-size: 14px; line-height: 1.8; }
.policy-page button { width: 100%; height: 48px; margin-top: 30px; color: var(--ink); background: var(--yellow); border: 0; border-radius: 6px; font-weight: 700; }

.upload-modal[hidden] { display: none; }
.upload-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.58); }
.upload-modal-panel { position: relative; width: min(100%, 360px); max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px; background: #fff; border-radius: 8px; text-align: center; box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.upload-modal-panel h2 { margin: 0 34px 14px; font-size: 19px; }
.upload-modal-panel img { display: block; width: 190px; max-width: 75%; margin: 0 auto 12px; border: 1px solid var(--line); }
.upload-modal-panel p { margin: 0 0 18px; font-size: 14px; font-weight: 700; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; padding: 0; color: #6d737c; background: transparent; border: 0; font-size: 28px; line-height: 1; cursor: pointer; }
.modal-upload-button { display: block; width: min(100%, 220px); min-height: 50px; margin: 0 auto; color: var(--ink); background: var(--yellow); border: 0; border-radius: 6px; font-weight: 800; cursor: pointer; }
.modal-upload-button:hover { background: var(--yellow-dark); }

.agreement-modal[hidden] { display: none; }
.agreement-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.58); }
.agreement-modal-panel { position: relative; width: min(100%, 380px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 22px; background: #fff; border-radius: 8px; box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.agreement-modal-panel section { min-height: 0; display: flex; flex-direction: column; }
.agreement-modal-panel section[hidden] { display: none; }
.agreement-modal-panel h2 { margin: 0 34px 16px; text-align: center; font-size: 19px; }
.agreement-copy { max-height: min(52vh, 420px); overflow-y: auto; padding: 14px; color: #515761; background: #f6f6f6; border: 1px solid var(--line); border-radius: 5px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.agreement-confirm { flex: none; width: 100%; min-height: 48px; margin-top: 18px; color: var(--ink); background: var(--yellow); border: 0; border-radius: 6px; font-weight: 800; cursor: pointer; }
.agreement-confirm:hover { background: var(--yellow-dark); }

@media (min-width: 481px) {
    .mobile-page { box-shadow: 0 0 40px rgba(0,0,0,.3); }
}
@media (prefers-reduced-motion: reduce) {
    * { transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
