:root {
  color-scheme: light;
  --ink: #152f2e; --muted: #526663; --green: #073f39; --accent: #deefac;
  --line: #cdd9d5; --paper: #f3f6f2;
  font: 100%/1.55 "DM Sans", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
.shell { width: min(1080px, calc(100% - 80px)); margin-inline: auto; }
.mast { background: #fff; border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 36px; min-height: 76px; }
a { color: inherit; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand-name { font-size: 1.25rem; font-weight: 750; letter-spacing: -.025em; }
.brand-logo { width: 30px; height: 30px; object-fit: contain; }
nav { display: flex; gap: 24px; margin-left: auto; align-self: stretch; }
nav a { display: grid; align-content: center; border-bottom: 3px solid transparent; padding: 3px 1px 0; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
nav a[aria-current] { color: var(--green); border-bottom-color: var(--green); }
main { flex: 1; }
.intro { padding: 48px 0 27px; }
h1,h2,h3,p,dl,dd { margin: 0; }
h1 { font-size: clamp(2.15rem, 4.7vw, 3.15rem); line-height: 1.18; letter-spacing: -.055em; font-weight: 750; }
.intro p { color: var(--muted); margin-top: 12px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.87fr) minmax(260px, 1fr); align-items: start; gap: 24px; padding-bottom: 44px; }
.panel { padding: 28px 32px 32px; background: white; border: 1px solid var(--line); border-radius: 14px; }
h2 { font-size: 1.32rem; letter-spacing: -.035em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
button,input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
label { display: block; font-weight: 650; font-size: .94rem; margin: 17px 0 7px; }
form > label:first-child { margin-top: 0; }
input:not([type=checkbox]) { display: block; width: 100%; min-width: 0; height: 46px; border: 1px solid #aabab5; border-radius: 6px; background: #fff; color: var(--ink); padding: 0 12px; }
input::placeholder { color: #637470; opacity: 1; }
.hint,.result .hint { font-size: .87rem; color: var(--muted); margin: 6px 0 0; }
.mono,#summary-ref { font-variant-numeric: tabular-nums; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; color: var(--muted); font-weight: 450; font-size: .9rem; }
input[type=checkbox] { margin: 3px 0 0; width: 17px; height: 17px; flex: none; accent-color: var(--green); }
.primary { width: 100%; margin-top: 2px; padding: 12px; border-radius: 7px; color: #fff; background: var(--green); border: 1px solid var(--green); font-weight: 700; transition: background .15s; }
.primary:hover:not(:disabled) { background: #19594d; }
#track-form .primary { margin-top: 20px; }
:focus-visible { outline: 3px solid #31806c; outline-offset: 3px; }
.ticket { border: 1px solid #b7ccc1; border-radius: 12px; background: #fafcf7; overflow: hidden; }
.ticket-top { position: relative; padding: 24px; min-height: 108px; display: flex; flex-direction: column; align-items: flex-start; gap: 13px; color: #f3faed; background: var(--green); isolation: isolate; overflow: hidden; }
.ticket-top::after { content: ""; position: absolute; z-index: -1; right: -26px; top: -66px; width: 180px; height: 200px; transform: rotate(28deg); background: repeating-linear-gradient(90deg,transparent 0 10px,#ffffff14 10px 12px); }
.paper-icon { height: 18px; width: 14px; border: 1.5px solid var(--accent); border-radius: 2px; position: relative; }
.paper-icon::after { content: ""; position: absolute; top: 4px; left: 3px; width: 6px; height: 1px; background: var(--accent); box-shadow: 0 4px var(--accent); }
.ticket-body { padding: 15px 24px; }
dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 8px 0; font-size: .92rem; }
dt { color: var(--muted); white-space: nowrap; }
dd { text-align: right; overflow-wrap: anywhere; font-weight: 650; }
.ticket-foot { position: relative; padding: 21px 24px 24px; border-top: 1px dashed #9eb8ab; }
.ticket-foot::before,.ticket-foot::after { content: ""; position: absolute; top: -8px; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #b7ccc1; background: var(--paper); }
.ticket-foot::before { left: -9px; } .ticket-foot::after { right: -9px; }
.ticket-foot h3 { font-size: 1rem; } .ticket-foot p { font-size: .9rem; margin-top: 5px; color: var(--muted); }
.text-button { background: none; padding: 4px 0; margin-top: 9px; border: none; font-size: .9rem; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.result { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.result-label { font-size: .88rem; color: var(--muted); }
.result h3 { display: inline-block; padding: 3px 12px; margin: 8px 0; border-radius: 6px; background: var(--accent); font-size: 1.25rem; }
.result[data-tone=attention] h3 { background: #ffebca; } .result[data-tone=failure] h3 { background: #ffe0dc; }
.error { border-left: 3px solid #a6382a; padding: 9px 12px; background: #fff3f1; color: #822f24; font-size: .93rem; margin: 12px 0; }
.admin-main { padding-bottom: 44px; }
.admin-login { max-width: 440px; }
#login-form .primary { margin-top: 20px; }
.code-head { flex-wrap: wrap; }
.code-actions,.code-controls { white-space: nowrap; }
.code-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.primary.compact { width: auto; margin: 0; padding: 7px 14px; }
.action { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: #fff; color: var(--green); font-weight: 650; }
.action:hover { background: var(--paper); }
.action.danger { color: #8b3329; }
.table-scroll { overflow-x: auto; }
.code-table { width: 100%; border-collapse: collapse; text-align: left; }
.code-table th,.code-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.code-table th { color: var(--muted); font-size: .92rem; background: var(--paper); }
.code-table code { font: .93rem/1.4 "IBM Plex Mono", ui-monospace, monospace; }
.code-status { display: inline-block; border-radius: 5px; padding: 2px 8px; background: #edf1ed; color: #465752; font-size: .88rem; }
.code-status.redeemed { background: #deefac; color: #26452b; }
.code-controls .action + .action { margin-left: 7px; }
footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-block: 17px 28px; color: var(--muted); font-size: .83rem; }
footer a { text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .bar { gap: 14px; min-height: 66px; }
  .intro { padding: 30px 0 20px; }
  .layout { grid-template-columns: 1fr; gap: 18px; }
  .panel { padding: 20px; }
  .ticket-top { min-height: 0; flex-direction: row; align-items: center; padding: 15px 20px; }
  .ticket-body,.ticket-foot { padding-inline: 20px; }
}
@media (max-width: 520px) {
  .bar { flex-wrap: wrap; gap: 0; padding-top: 13px; }
  nav { order: 3; width: 100%; margin: 8px 0 0; gap: 24px; }
  nav a { padding-block: 9px; }
  .panel { padding: 17px; }
}
