:root {
  --paper: #f7f4ff;
  --paper-warm: #fff8f1;
  --ink: #1b1836;
  --muted: #706b8d;
  --line: rgba(27, 24, 54, 0.13);
  --violet: #6558f5;
  --violet-deep: #493dd1;
  --violet-soft: #e9e6ff;
  --coral: #ff6b4a;
  --coral-soft: #ffe2da;
  --yellow: #ffd76a;
  --mint: #b8f0d2;
  --white: #ffffff;
  --shadow: 8px 8px 0 rgba(27, 24, 54, 0.12);
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(101, 88, 245, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 88, 245, .07) 1px, transparent 1px),
    radial-gradient(circle at 90% 7%, rgba(255, 107, 74, .23), transparent 23rem),
    var(--paper);
  background-size: 24px 24px, 24px 24px, auto, auto;
  font-family: "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
.hidden { display: none !important; }

.page-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 17px calc(34px + env(safe-area-inset-bottom));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
}
.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: none;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--coral);
  box-shadow: 4px 4px 0 var(--ink);
}
.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  position: absolute;
  display: block;
  content: "";
}
.brand-mark::before { width: 25px; height: 3px; background: white; transform: rotate(-22deg); }
.brand-mark::after { width: 18px; height: 18px; border-right: 3px solid white; border-bottom: 3px solid white; transform: rotate(-22deg); }
.brand-mark i { right: 10px; bottom: 9px; width: 14px; height: 3px; background: white; transform: rotate(-68deg); }
.brand > div:nth-child(2) { min-width: 0; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.brand-status {
  margin-left: auto;
  border: 1px solid rgba(27, 24, 54, .18);
  border-radius: 999px;
  padding: 6px 9px;
  color: #176545;
  background: var(--mint);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.eyebrow,
.login-kicker {
  margin: 0 0 4px;
  color: var(--violet-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero-card,
.state-card,
.step-card,
.assignment-card,
.progress-card,
.finish-card,
.report-card,
.submission-card {
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 25px;
  text-align: center;
}
.hero-card::before {
  position: absolute;
  top: -46px;
  right: -42px;
  width: 120px;
  height: 120px;
  border: 18px solid var(--yellow);
  border-radius: 50%;
  content: "";
}
.hero-ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr repeat(3, 31px);
  align-items: center;
  gap: 6px;
  margin: 0 0 24px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  padding: 15px;
  color: white;
  background: var(--ink);
  text-align: left;
}
.hero-ticket::before,
.hero-ticket::after {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 25px;
  border: 2px solid var(--ink);
  background: white;
  content: "";
  transform: translateY(-50%);
}
.hero-ticket::before { left: -10px; border-radius: 0 20px 20px 0; border-left: 0; }
.hero-ticket::after { right: -10px; border-radius: 20px 0 0 20px; border-right: 0; }
.ticket-label { grid-column: 1 / -1; color: var(--yellow); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.hero-ticket strong { font-size: 19px; }
.hero-ticket i { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--ink); background: var(--yellow); font-size: 10px; font-style: normal; font-weight: 900; }
.hero-ticket i:nth-of-type(2) { background: var(--coral); }
.hero-ticket i:nth-of-type(3) { background: var(--mint); }
.pill { display: inline-flex; border: 1px solid var(--violet); border-radius: 999px; padding: 7px 12px; color: var(--violet-deep); background: var(--violet-soft); font-size: 11px; font-weight: 900; }
.hero-card h2 { margin: 17px 0 10px; font-size: 31px; line-height: 1.22; letter-spacing: -.04em; }
.hero-copy { max-width: 400px; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 1.75; }
.promise-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 22px 0; }
.promise-row span { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 3px; color: var(--muted); background: var(--paper); font-size: 10px; font-weight: 800; }
.promise-row b { color: var(--coral); font-family: "Segoe UI", sans-serif; font-size: 13px; }
.fine-print, .helper { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

.button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  padding: 13px 18px;
  color: white;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.button:active { box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-large { min-height: 58px; font-size: 17px; }
.button-primary { background: var(--violet); }
.button-dark { background: var(--ink); }
.button-accent { background: var(--coral); }
.button-quiet { color: var(--ink); background: var(--yellow); }

.state-card { padding: 52px 22px; color: var(--muted); text-align: center; }
.state-icon { display: inline-flex; margin-bottom: 16px; border: 2px solid var(--ink); border-radius: 999px; padding: 8px 13px; color: var(--ink); background: var(--yellow); font-size: 12px; font-weight: 900; }
.loader { display: inline-block; width: 31px; height: 31px; margin-bottom: 14px; border: 4px solid var(--violet-soft); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.assignment-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; overflow: hidden; padding: 19px; background: var(--ink); color: white; }
.assignment-card::after { position: absolute; right: -28px; bottom: -52px; width: 110px; height: 110px; border: 15px solid var(--coral); border-radius: 50%; content: ""; }
.assignment-card .eyebrow { color: var(--yellow); }
.assignment-card h2 { position: relative; z-index: 1; margin: 0; font-size: 21px; }
.material-code { position: relative; z-index: 1; flex: none; border: 1px dashed rgba(255,255,255,.7); border-radius: 10px; padding: 8px 9px; color: var(--ink); background: var(--yellow); font: 900 11px ui-monospace, monospace; letter-spacing: .04em; }
.progress-card { margin-top: 13px; padding: 15px 17px; box-shadow: 4px 4px 0 rgba(27,24,54,.09); }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.progress-copy strong { color: var(--ink); }
.progress-track { height: 8px; margin-top: 11px; overflow: hidden; border: 1px solid var(--ink); border-radius: 99px; background: var(--violet-soft); }
.progress-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--violet), var(--coral)); transition: width .35s ease; }

.opc-binding-card { margin-top: 16px; border: 2px solid var(--ink); border-radius: 18px; padding: 18px; color: white; background: linear-gradient(135deg, var(--violet-deep), var(--violet)); box-shadow: 5px 5px 0 var(--ink); }
.opc-binding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.opc-binding-head .eyebrow { color: var(--yellow); }
.opc-binding-card h3 { margin: 0; font-size: 18px; }
.opc-badge { flex: none; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 6px 9px; color: var(--ink); background: var(--yellow); font-size: 10px; font-weight: 900; }
.opc-binding-card > p:not(.eyebrow) { margin: 12px 0; color: rgba(255,255,255,.84); font-size: 12px; line-height: 1.65; }
.source-title-row { display: flex; align-items: baseline; gap: 10px; border: 1px dashed rgba(255,255,255,.48); border-radius: 11px; padding: 11px 12px; background: rgba(255,255,255,.1); }
.source-title-row span { flex: none; color: var(--yellow); font-size: 11px; font-weight: 800; }
.source-title-row strong { min-width: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.opc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.opc-actions .button { min-height: 42px; box-shadow: 3px 3px 0 var(--ink); }
.opc-actions .button-quiet { color: var(--ink); }

.step-card { position: relative; margin-top: 16px; padding: 19px; }
.step-card:nth-of-type(odd) { background: var(--paper-warm); }
.step-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.step-heading > div { min-width: 0; flex: 1; }
.step-heading h3 { margin: 0 0 4px; font-size: 17px; }
.step-heading p { margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.step-number, .step-check { display: grid; width: 37px; height: 37px; flex: none; place-items: center; border: 2px solid var(--ink); border-radius: 11px; color: var(--ink); background: var(--yellow); font: 900 13px "Segoe UI", sans-serif; box-shadow: 3px 3px 0 var(--ink); }
.step-check { display: none; color: white; background: #2dbc7a; }
.step-card.done .step-number { display: none; }
.step-card.done .step-check { display: grid; }
.cover-frame { aspect-ratio: 9 / 13; margin-bottom: 15px; overflow: hidden; border: 2px solid var(--ink); border-radius: 13px; background: #090909; }
.cover-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.copy-preview { width: 100%; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 15px; color: var(--ink); background: white; font: inherit; text-align: left; cursor: pointer; }
.copy-preview span { display: -webkit-box; overflow: hidden; font-size: 13px; line-height: 1.75; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.copy-preview.expanded span { display: block; max-height: 320px; overflow: auto; }
.creator-field { display: grid; gap: 8px; margin: 14px 0; font-size: 12px; font-weight: 900; }
.creator-field input { width: 100%; min-height: 48px; border: 2px solid var(--ink); border-radius: 11px; padding: 0 12px; color: var(--ink); background: white; font: inherit; font-size: 14px; }
.creator-field input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(101,88,245,.15); outline: none; }
.creator-name-label { margin: 8px 0 0; color: var(--violet-deep); font-size: 12px; font-weight: 900; }
.copy-preview b { display: block; margin-top: 8px; color: var(--violet-deep); font-size: 11px; }

.next-claim-card { margin-top: 16px; border: 2px solid var(--ink); border-radius: 18px; padding: 18px; background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); }
.next-claim-card h3 { margin: 0 0 5px; font-size: 17px; }
.next-claim-card p:not(.eyebrow) { margin: 0 0 14px; color: #5e563a; font-size: 12px; line-height: 1.65; }
.extra-claim-head { display: grid; gap: 4px; margin-top: 16px; border-top: 2px dashed rgba(27,24,54,.25); padding-top: 15px; }
.extra-claim-head strong { font-size: 14px; }
.extra-claim-head span { color: #5e563a; font-size: 11px; line-height: 1.55; }
.grant-help { margin: 10px 0 0 !important; font-size: 10px !important; }
.grant-box { display: grid; gap: 10px; margin-top: 11px; }
.grant-box input { width: 100%; min-height: 48px; border: 2px solid var(--ink); border-radius: 11px; padding: 0 13px; color: var(--ink); background: white; font: inherit; font-size: 14px; outline: none; }
.grant-box input:focus, .submission-card textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(101,88,245,.15); }

.finish-card { margin-top: 16px; padding: 27px 21px; text-align: center; background: var(--mint); }
.finish-card h2 { margin-bottom: 8px; }
.finish-card p { color: #276246; font-size: 13px; line-height: 1.7; }
.finish-badge { display: grid; width: 50px; height: 50px; margin: 0 auto 14px; place-items: center; border: 2px solid var(--ink); border-radius: 14px; color: white; background: #2dbc7a; box-shadow: 4px 4px 0 var(--ink); font-size: 22px; font-weight: 900; }
.submission-card { display: grid; gap: 13px; margin-top: 16px; padding: 19px; }
.submission-card h3, .report-card h3 { margin-bottom: 5px; }
.submission-card p:not(.eyebrow), .report-card p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.submission-card textarea { width: 100%; resize: vertical; border: 2px solid var(--ink); border-radius: 11px; padding: 12px; color: var(--ink); background: white; font: inherit; font-size: 13px; line-height: 1.6; outline: none; }
.opc-keyword-field { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 900; }
.opc-keyword-field input { width: 100%; min-height: 46px; border: 2px solid var(--ink); border-radius: 11px; padding: 0 12px; color: var(--ink); background: #fff8db; outline: none; }
.opc-keyword-field input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(101,88,245,.15); }
.submitted-link { overflow: hidden; border: 1px solid #2dbc7a; border-radius: 10px; padding: 10px 11px; color: #176545; background: var(--mint); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.contact-fields { display: grid; grid-template-columns: minmax(104px, 1fr) minmax(0, 2fr); gap: 10px; margin: 14px 0; text-align: left; }
.contact-fields label, .submission-card > label { display: grid; gap: 7px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 900; text-align: left; }
.contact-fields input, .contact-fields select, .submission-card > label input { width: 100%; min-width: 0; min-height: 46px; border: 2px solid var(--ink); border-radius: 11px; padding: 0 10px; color: var(--ink); background: white; font: inherit; font-size: 13px; outline: none; }
.contact-fields input:focus, .contact-fields select:focus, .submission-card > label input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(101,88,245,.15); }
.claim-date-label { margin: 8px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.receipt-surface { border: 2px solid var(--ink); border-radius: 20px; padding: 18px; background: white; box-shadow: var(--shadow); }
.receipt-kicker { margin: 0 0 6px; color: var(--violet-deep); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.receipt-surface h2 { margin: 0; font-size: 22px; }
.receipt-main-date { margin: 13px 0 0; color: var(--violet-deep); font-size: clamp(32px, 9vw, 44px); line-height: 1.08; font-weight: 950; letter-spacing: -.04em; }
.receipt-time { margin: 4px 0 15px; font-size: 12px; font-weight: 800; }
.receipt-facts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.receipt-facts > div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.receipt-facts span, .receipt-link-row span { color: var(--muted); font-weight: 800; }
.receipt-facts strong, .receipt-link-row strong { min-width: 0; overflow-wrap: anywhere; }
.receipt-links { margin-top: 12px; }
.receipt-link-row { display: grid; grid-template-columns: 55px minmax(0, 1fr); gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.45; }
.receipt-link-row strong { font-weight: 700; }
.receipt-updated { margin: 14px 0 0; font-size: 11px; font-weight: 900; }
.receipt-note { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.receipt-guide { margin: 17px 0 12px; color: var(--muted); font-size: 12px; text-align: center; }
#receiptBackButton { width: 100%; }
.report-card { display: grid; gap: 14px; margin-top: 16px; padding: 19px; }

.modal-open { overflow: hidden; }
.save-guide { position: fixed; z-index: 20; inset: 0; overflow: auto; padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); background: rgba(27,24,54,.91); -webkit-overflow-scrolling: touch; }
.save-guide-panel { width: min(100%, 560px); margin: 0 auto; border: 2px solid var(--ink); border-radius: 18px; padding: 17px; background: white; box-shadow: 9px 9px 0 var(--coral); }
.save-guide-copy { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.save-guide-copy h2 { margin-bottom: 5px; font-size: 21px; }
.save-guide-copy p:not(.eyebrow) { margin-bottom: 15px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.guide-close { width: 38px; height: 38px; flex: none; border: 2px solid var(--ink); border-radius: 10px; color: var(--ink); background: var(--yellow); font-size: 24px; line-height: 1; }
.save-guide-panel img { display: block; width: 100%; max-height: 70vh; margin-bottom: 14px; border: 2px solid var(--ink); border-radius: 12px; object-fit: contain; background: #090909; -webkit-touch-callout: default; }
footer { padding: 27px 5px 0; color: var(--muted); font-size: 10px; text-align: center; }
.toast { position: fixed; z-index: 10; right: 20px; bottom: calc(22px + env(safe-area-inset-bottom)); left: 20px; max-width: 430px; margin: auto; border: 2px solid white; border-radius: 12px; padding: 13px 16px; color: white; background: rgba(27,24,54,.97); box-shadow: 5px 5px 0 var(--coral); font-size: 13px; font-weight: 800; text-align: center; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (min-width: 700px) {
  .page-shell { width: min(100%, 760px); padding-top: 38px; padding-bottom: 50px; }
  .hero-card { padding: 27px 33px 31px; }
  .cover-frame { max-height: 680px; }
  .report-card { grid-template-columns: 1fr 190px; align-items: center; }
}
@media (max-width: 380px) {
  .brand-status { display: none; }
  .hero-card h2 { font-size: 27px; }
  .hero-ticket { grid-template-columns: 1fr repeat(3, 27px); }
  .hero-ticket i { width: 27px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
