:root {
  --paper: #f5f2e9;
  --surface: #fffdf6;
  --ink: #20342c;
  --muted: #5e6a60;
  --accent: #993e30;
  --dark: #19392e;
  --line: #d8d6c6;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --xiaoli: "ZCOOL XiaoLi", "ZCOOL XiaoWei", "STKaiti", "KaiTi", "STFangsong", serif;
  --print: "STFangsong", "华文仿宋", "FangSong", "仿宋", "SimSun", serif;
  --hand: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", serif;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--sans); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 3px solid #b95732; outline-offset: 4px; }
figure, h1, h2, h3, p { margin: 0; }
.wrap { width: min(100% - 96px, 1340px); margin-inline: auto; }
.site-head { min-height: 82px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; line-height: 1.14; text-decoration: none; white-space: nowrap; }
.brand small { display: block; margin-top: 5px; font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: .09em; }
.brand-mark { display: grid; place-items: center; flex: 0 0 40px; height: 40px; background: var(--dark); color: var(--surface); border-radius: 8px 8px 8px 2px; font: 700 1.42rem/1 var(--serif); }
.text-link { background: none; border: 0; padding: 0; font-weight: 700; color: var(--ink); text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.head-link { font-size: .9rem; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 1.2em; border: 1px solid transparent; border-radius: 5px; padding: .68em 1.1em; font-weight: 750; line-height: 1.35; text-decoration: none; text-align: center; }
.primary { background: var(--accent); color: #fffdf4; }
.primary:hover:not(:disabled) { background: #7d2e22; }
.cream { background: #fff0cc; color: var(--dark); }
.cream:hover:not(:disabled) { background: white; }
.outline { background: transparent; border-color: #b9b9a8; }
.outline:hover:not(:disabled) { background: #eae8dc; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 1.55rem; line-height: 1; }

.task-main { padding-block: clamp(26px, 5vh, 60px) 22px; }
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 1fr); align-items: center; gap: clamp(14px, 2.6vw, 36px); }
.editorial { align-self: stretch; display: flex; flex-direction: column; }
.photo-frame { position: relative; overflow: hidden; height: clamp(220px, 39vh, 390px); border-radius: 4px; background: var(--dark); }
.photo-frame img { height: 100%; width: 100%; object-fit: cover; }
.project-photo img { object-position: 43% 50%; }
.case-photo img { object-position: 49% 27%; }
.photo-label { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 3px; font-weight: 750; font-size: .79rem; background: var(--surface); }
.editorial figcaption { border-bottom: 1px solid var(--line); padding: 12px 0 10px; }
.caption-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: clamp(1.05rem, 1.7vw, 1.55rem); line-height: 1.25; }
.audience { color: var(--accent); border: 1px solid #bd7765; border-radius: 3px; padding: 2px 8px; background: #f3e3d9; font: 750 .82rem/1.3 var(--sans); white-space: nowrap; }
.editorial p { color: var(--muted); font-size: clamp(.76rem, 1.03vw, .93rem); margin-top: 5px; }
.task-center { text-align: center; padding-block: 12px 18px; }
.task-kicker { display: inline-flex; align-items: center; gap: .8em; color: var(--accent); font-weight: 750; letter-spacing: .22em; }
.task-kicker::before, .task-kicker::after { content: ""; height: 1px; width: 1.55em; background: #b07763; }
.task-center h1 { margin-top: .25em; font: 900 clamp(2.05rem, 4.82vw, 4.55rem)/1.18 var(--serif); letter-spacing: -.045em; }
.task-center h1 span, .task-center h1 em { display: block; }
.task-center h1 em { color: var(--accent); margin-top: .16em; font-style: normal; }
.participate { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(15px, 3.6vw, 48px); margin-top: clamp(20px, 4vh, 48px); padding: 12px 25px; background: #e9e7dc; border: 1px solid var(--line); border-radius: 5px; }
.participate strong { font-size: clamp(1.12rem, 1.8vw, 1.5rem); }

.activity-main { width: min(100% - 96px, 1210px); padding-block: clamp(24px, 4vw, 48px) 70px; }
.activity-heading h1 { font: 900 clamp(2.15rem, 4.5vw, 4rem)/1.2 var(--serif); letter-spacing: -.04em; }
.activity-hero { display: grid; grid-template-columns: minmax(0, 1.92fr) minmax(264px, 1fr); gap: 14px; margin-top: 25px; }
.hero-create, .hero-draw { position: relative; overflow: hidden; border-radius: 6px; padding: clamp(23px, 3vw, 42px); min-height: clamp(258px, 27vw, 345px); display: flex; flex-direction: column; justify-content: center; }
.hero-create { background: #18392e; color: #fff4df; isolation: isolate; }
.hero-create::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-radial-gradient(ellipse at 100% 110%, transparent 0 22px, #ffffff12 23px 24px, transparent 25px 35px); }
.hero-copy { position: relative; z-index: 1; width: fit-content; }
.hero-role { font-weight: 700; letter-spacing: .11em; font-size: .86rem; }
.hero-create .hero-role { color: #e7c08a; }
.hero-draw .hero-role { color: var(--accent); }
.activity-hero h2 { margin-top: .28em; font: 900 clamp(2rem, 3.6vw, 3.35rem)/1.05 var(--serif); letter-spacing: -.04em; }
.hero-draw > p:not(.hero-role) { color: #5c5149; font-size: .92rem; }
.activity-hero .button { margin-top: 20px; min-width: 172px; }
.hero-draw { background: #ead7cb; border: 1px solid #ded0bc; align-items: flex-start; isolation: isolate; }
.draw-benefit { font-size: .88rem; color: #62473c; margin-top: 12px; }
.hero-draw::after { content: ""; position: absolute; right: -28px; bottom: -25px; width: min(48%, 195px); aspect-ratio: 1; z-index: -1; border: 6px double #a77763; border-radius: 50%; opacity: .38; transform: rotate(14deg); background: #bf9274 url("/assets/templates/tang-garden.webp") center / cover; pointer-events: none; }
.hero-draw .draw-status { min-height: 1.4em; margin-top: 8px; color: #614a41; font-size: .78rem; }
.hero-art { position: absolute; width: min(50%, 364px); aspect-ratio: 1.22; top: 49%; right: 3%; transform: translateY(-45%); z-index: 0; }
.hero-ticket-front, .hero-ticket-back { position: absolute; width: 92%; height: 66%; border-radius: 6px; }
.hero-ticket-back { top: 21%; right: 0; transform: rotate(14deg); background: #b3543e; border: 1px solid #efb692; }
.hero-ticket-front { top: 15%; right: 5%; display: grid; grid-template-columns: 1fr 20%; transform: rotate(-11deg); background: #edc995; color: #242f2a; box-shadow: 0 8px 24px #0c1f2080; }
.hero-ticket-front::before, .hero-ticket-front::after { content: ""; position: absolute; z-index: 1; right: calc(20% - 7px); width: 14px; height: 14px; border-radius: 50%; background: #1a3c31; }
.hero-ticket-front::before { top: -7px; }
.hero-ticket-front::after { bottom: -7px; }
.hero-ticket-copy { padding: 8%; display: flex; align-items: end; color: #fff6d6; background: linear-gradient(8deg, #1d201ae8, #1425211a 66%), url("/assets/templates/ink-night.webp") center / cover; line-height: 1.15; }
.hero-ticket-copy strong { font: 900 clamp(.84rem, 2.4vw, 1.9rem)/1.02 var(--serif); }
.hero-ticket-stub { display: flex; flex-direction: column; justify-content: end; align-items: center; padding-bottom: 18%; gap: 7px; font-size: clamp(.53rem, 1vw, .82rem); font-weight: 800; border-left: 1px dashed #705241; }
.hero-ticket-stub span { color: #733c2d; writing-mode: vertical-rl; font-family: var(--hand); padding: .35em .2em; border: 1px solid currentColor; border-radius: 1px; }

.collection { margin-top: 42px; }
.collection-heading { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 8px; }
.editor-heading h2 { font: 900 clamp(1.6rem, 3vw, 2.4rem)/1.15 var(--serif); }
.collection-heading .text-link { min-height: 38px; font-size: .87rem; white-space: nowrap; }
[role="tablist"] { display: flex; gap: clamp(7px, 2.7vw, 33px); }
.tab { border: 0; border-bottom: 3px solid transparent; background: none; padding: 9px 5px; font-size: .92rem; color: var(--muted); white-space: nowrap; }
.tab[aria-selected="true"] { font-weight: 800; color: var(--ink); border-color: var(--accent); }
#pool-count { margin-left: 2px; font-size: .78rem; }
#tab-panel { padding-top: 18px; }
.empty { background: var(--surface); border: 1px dashed #c6c8b6; border-radius: 5px; color: var(--muted); padding: 24px; }
.recent-block { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
.recent-block h3 { font-size: 1rem; margin-bottom: 10px; }
.recent-list { display: flex; gap: 8px; flex-wrap: wrap; }
.recent-item { padding: 6px 10px; display: inline-flex; gap: 9px; align-items: center; max-width: 100%; border-radius: 3px; border: 1px solid #e1cdbf; background: #fff2e6; font-size: .83rem; overflow-wrap: anywhere; }
.recent-item small { color: #753326; }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: 13px; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 13px; margin-top: 18px; }

.editor { margin-top: 24px; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.18fr); gap: clamp(15px, 3vw, 38px); align-items: start; }
.editor-form { padding: clamp(16px, 2.6vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.form-block { position: relative; margin: 0 0 20px; padding: 0; border: 0; min-inline-size: 0; }
.form-block label, .form-block legend { display: block; margin-bottom: 8px; font-weight: 800; padding: 0; }
.form-block small { font-weight: 500; color: var(--muted); padding-left: 7px; }
input { width: 100%; border: 1px solid #abaf9e; border-radius: 4px; background: #fffef9; color: var(--ink); padding: 10px 11px; }
select { width: 100%; border: 1px solid #abaf9e; border-radius: 4px; background: #fffef9; color: var(--ink); padding: 10px 11px; cursor: pointer; }
.field-row { display: flex; align-items: center; gap: 8px; }
.field-row select { flex: 1 1 0; min-width: 0; }
.field-arrow { flex: none; color: var(--muted); font-weight: 700; }
.ai-button { margin-top: 9px; }
.ai-options { margin-top: 10px; }
.ai-options-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: .78rem; }
.ai-options-head .text-link { font-size: .78rem; min-height: 30px; }
.ai-options-list { display: grid; gap: 5px; }
.ai-option { display: grid; gap: 3px; width: 100%; padding: 8px 11px; text-align: left; border: 1px solid #d6d6c6; border-left: 3px solid #d6d6c6; border-radius: 4px; background: #faf9f0; color: inherit; font: inherit; cursor: pointer; }
.ai-option:hover { border-color: #9f7666; }
.ai-option[aria-pressed="true"] { border-color: var(--accent); border-left-color: var(--accent); background: #ffefe3; }
.ai-option-text { font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere; }
.ai-option-meta { color: var(--muted); font-size: .72rem; }
.form-note { color: var(--muted); font-size: .86rem; }
.form-note:not(:empty) { margin-top: 8px; }
.form-note.error { color: #8b2c20; }
.template-grid, .sticker-grid { display: grid; gap: 6px; }
.template-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.template-thumbnail { width: 100%; aspect-ratio: 1.55; border-radius: 3px; object-fit: cover; background: #d8d1c0; }
.choice { display: grid; align-content: start; gap: 3px; min-height: 44px; padding: 5px; border: 1px solid #d6d6c6; border-radius: 4px; background: #faf9f0; line-height: 1.3; font-size: .78rem; }
.choice:hover { border-color: #9f7666; }
.choice[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); border-color: var(--accent); background: #ffefe3; font-weight: 800; }
.template-archive { margin-top: 13px; font-size: .88rem; }
.template-archive summary { cursor: pointer; font-weight: 700; }
.template-archive .template-grid { margin-top: 8px; }
.template-archive a { display: inline-block; margin-top: 8px; font-size: .76rem; text-underline-offset: 3px; }
#templates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sticker-tray { margin-top: 12px; }
.sticker-heading { display: flex; min-height: 30px; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 5px; }
.sticker-heading h4 { margin: 0; font-size: .89rem; }
.sticker-heading small { color: var(--muted); font-weight: 500; margin-left: 4px; }
#remove-sticker, #undo-sticker { color: var(--accent); font-size: .78rem; }
.sticker-actions { display: flex; align-items: center; gap: 10px; }
.sticker-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.sticker-choice { position: relative; place-content: center; touch-action: pan-y; user-select: none; cursor: grab; }
.sticker-choice.on-ticket::after { content: ""; position: absolute; right: 4px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: #487864; }
.sticker-choice:active, .placed-sticker:active { cursor: grabbing; }
#sticker-hint { margin-bottom: 0; font-size: .76rem; }
.sticker-icon { width: 34px; height: 34px; display: block; flex: none; filter: drop-shadow(0 1px 1px #fcebc1); }
.sticker-choice .sticker-icon { width: 33px; height: 33px; }
.editor-preview { position: sticky; top: 16px; padding: clamp(13px, 2vw, 24px); border: 1px solid var(--line); background: #eae9dc; border-radius: 6px; }
.editor-preview h3 { font-size: .9rem; margin-bottom: 9px; }
#preview { outline: 2px solid transparent; outline-offset: 3px; border-radius: 6px; transition: outline-color .12s ease; }
#preview.receiving-sticker { outline-color: #996c3f; outline-style: dashed; }
.sticker-ghost { pointer-events: none; position: fixed; z-index: 100; height: auto; transform: translate(-50%, -50%); opacity: .7; filter: drop-shadow(0 6px 12px #00000055); }
.sticker-ghost.is-over { opacity: 1; }

.ticket { position: relative; isolation: isolate; container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr) max(26%, 58px); border-radius: 6px; overflow: hidden; min-height: 151px; color: var(--ticket-ink); background: linear-gradient(135deg, var(--ticket-base), var(--ticket-shade)); }
.ticket-full { min-height: clamp(164px, 20vw, 250px); }
.ticket-art { position: relative; min-height: 110px; overflow: hidden; background: var(--ticket-shade); }
.ticket-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ticket--panorama { grid-template-columns: minmax(0, 1fr) max(26%, 58px); grid-template-rows: auto 1fr; }
.ticket--panorama .ticket-art { grid-column: 1; grid-row: 1; height: clamp(96px, 11vw, 140px); min-height: 0; border-bottom: 1px solid var(--ticket-accent); }
.ticket--panorama.ticket-full .ticket-art { height: clamp(132px, 15vw, 191px); }
.ticket--panorama .ticket-content { grid-column: 1; grid-row: 2; }
.ticket--panorama .ticket-stub { grid-column: 2; grid-row: 1 / 3; }
.ticket--window .ticket-art, .ticket--specimen .ticket-art { align-self: start; min-height: 0; margin: 13px 6px 13px 0; aspect-ratio: .72; }
.ticket--window .ticket-art { border: 1px solid var(--ticket-accent); border-radius: 50% 50% 4px 4px / 32% 32% 4px 4px; }
.ticket--specimen .ticket-art { border: 4px solid #f4e4c7; border-radius: 2px; transform: rotate(-4deg); box-shadow: 1px 3px 6px #271c1c44; }
.ticket--specimen .ticket-image { object-fit: contain; background: #ddd3be; }
.ticket-full .ticket-art { margin-top: 17px; margin-right: 10px; }
.ticket--panorama.ticket-full .ticket-art { margin: 0; }
.ticket-content { display: grid; gap: .35rem; align-content: space-between; position: relative; padding: 13px; min-width: 0; }
.ticket-full .ticket-content { padding: clamp(14px, 2vw, 23px); }
.ticket-district { font-family: var(--xiaoli); font-size: .78rem; font-weight: 400; letter-spacing: .12em; }
.ticket-message { font: 700 1.22rem/1.25 var(--serif); overflow-wrap: anywhere; white-space: normal; letter-spacing: -.01em; }
.ticket-full .ticket-message { font-size: clamp(1.25rem, 2.6vw, 2.05rem); }
.ticket-signature { font-size: .76rem; overflow-wrap: anywhere; }
.ticket-stickers { display: flex; flex-wrap: wrap; gap: 2px; }
.ticket-stickers .sticker-icon { width: 24px; height: 24px; }
.ticket-full .ticket-stickers .sticker-icon { width: 29px; height: 29px; }
.ticket-stub { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: max(2px, .5cqw); padding: 6% 3% 4%; border-left: 1px dashed #8d6a4a; color: #432f23; text-align: center; background: linear-gradient(135deg, #fff0d5, #e9cba1); font-family: var(--print); }
.ticket-stub::before, .ticket-stub::after { position: absolute; z-index: 1; content: ""; left: -.95cqw; width: 1.9cqw; height: 1.9cqw; background: var(--paper); border-radius: 50%; }
.ticket-stub::before { top: -.95cqw; }
.ticket-stub::after { bottom: -.95cqw; }
.ticket-stub-heading { display: flex; align-items: center; justify-content: center; gap: max(2px, .65cqw); }
.ticket-stub-heading .ticket-project-mark { flex: none; width: max(13px, 4.2cqw); height: max(13px, 4.2cqw); border-radius: 3px 3px 3px 1px; background: #534232; color: #fff0d1; font: 400 max(8px, 2.9cqw)/1 var(--print); }
.ticket-stub-type { font: 400 max(8px, 2.8cqw)/1.15 var(--print); letter-spacing: .1em; white-space: nowrap; }
.ticket-issue { position: absolute; left: 0; bottom: 10.5%; transform: translateX(-50%); display: grid; justify-items: center; gap: .25cqw; padding: 2px 5px; text-align: center; background: rgba(250, 238, 214, .88); border-radius: 1px; box-shadow: 0 1px 3px #3c28140f; }
.ticket-issue-cut { position: absolute; z-index: 0; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: repeating-linear-gradient(to bottom, #9c7444 0 3px, transparent 3px 7px); }
.ticket-issue > *:not(.ticket-issue-cut) { position: relative; z-index: 1; }
.ticket-serial { font: 700 max(7px, 1.75cqw)/1.1 var(--print); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.ticket-issue-date { font-size: max(6px, 1.25cqw); line-height: 1.2; opacity: .85; white-space: nowrap; letter-spacing: .02em; }
.ticket-seal { position: absolute; left: 62%; bottom: 1%; z-index: 2; width: max(24px, 11.5cqw); aspect-ratio: 1; transform: translateX(-50%) rotate(-8deg); opacity: .9; }
.ticket-seal-image { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.ticket-seal-fallback { display: none; place-items: center; width: 100%; height: 100%; padding: 12%; border: 1.5px solid #9c3b28; border-radius: 50%; color: #9c3b28; font: 800 max(6px, 1.45cqw)/1.1 var(--print); letter-spacing: -.04em; text-align: center; }
.ticket-seal.is-fallback .ticket-seal-image { display: none; }
.ticket-seal.is-fallback .ticket-seal-fallback { display: grid; }
.ticket-stub-foot { display: grid; justify-items: center; gap: .3cqw; padding-left: 20%; text-align: center; line-height: 1.3; letter-spacing: .08em; }
.ticket-credit { font-size: max(7px, 1.45cqw); opacity: .62; text-underline-offset: 2px; }
.ticket-publisher { display: inline-flex; align-items: baseline; gap: 1em; white-space: nowrap; font-size: max(8px, 1.7cqw); font-weight: 600; letter-spacing: .1em; }
.ticket:not(.ticket-full) .ticket-stub-foot { display: none; }
.ticket-specs { display: grid; gap: 1.1cqw; width: 100%; padding-block: .4cqw; }
.ticket-spec { display: grid; justify-items: center; gap: .15cqw; line-height: 1.15; }
.ticket-spec-label { font-size: max(7px, 1.38cqw); font-weight: 600; letter-spacing: .18em; opacity: .7; }
.ticket-spec-value { font-size: max(8px, 1.7cqw); font-weight: 600; letter-spacing: -.005em; white-space: nowrap; }
.ticket:not(.ticket-full) .ticket-specs { display: none; }

.ticket--collectible { display: block; container-type: inline-size; aspect-ratio: 2 / 1; min-height: 0; border-radius: 4px; background: var(--ticket-base); }
.ticket--collectible .ticket-art { position: absolute; inset: 0 26% 0 0; min-height: 0; margin: 0; }
.ticket--collectible .ticket-art::before,
.ticket--collectible .ticket-art::after { position: absolute; content: ""; z-index: 1; pointer-events: none; }
.ticket--collectible .ticket-art::before { inset: 0; background: linear-gradient(90deg, var(--ticket-shade), color-mix(in srgb, var(--ticket-shade) 90%, transparent) 28%, color-mix(in srgb, var(--ticket-shade) 53%, transparent) 53%, transparent 72%); }
.ticket--collectible .ticket-art::after { inset: 2.7%; border: 1px solid color-mix(in srgb, var(--ticket-accent) 70%, transparent); box-shadow: inset 0 0 0 2px #ffffff10; border-radius: 1px; }
.ticket--collectible .ticket-content { position: absolute; z-index: 2; inset: 9% auto 15% 5.5%; width: 42%; padding: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1.2cqw; }
.ticket--collectible .ticket-district { font-size: max(8px, 2.55cqw); color: var(--ticket-ink); letter-spacing: .15em; }
.ticket--collectible .ticket-message { max-width: 100%; font-size: max(13px, 6.85cqw); line-height: 1.11; letter-spacing: -.025em; text-wrap: pretty; }
.ticket--collectible .ticket-message-medium { font-size: max(11px, 5.15cqw); }
.ticket--collectible .ticket-message-long { font-size: max(9px, 4cqw); }
.ticket--collectible .ticket-signature { max-width: 100%; font-family: var(--xiaoli); font-size: max(10px, 3cqw); letter-spacing: .08em; }
.ticket--collectible .ticket-stub { position: absolute; z-index: 2; inset: 0 0 0 auto; width: 26%; padding: 6% 4% 2.5%; }
.ticket-overlay { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.ticket-stage { position: relative; }
.placed-sticker { position: absolute; display: block; width: 10%; aspect-ratio: 1; padding: 0; border: none; background: transparent; border-radius: 4px; transform: translate(-50%, -50%) rotate(var(--sticker-rotate, 0deg)); transform-origin: 50% 50%; -webkit-tap-highlight-color: transparent; }
.editable-overlay .placed-sticker { touch-action: none; user-select: none; cursor: grab; pointer-events: auto; }
.placed-sticker .sticker-icon { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.placed-sticker.is-moving { cursor: grabbing; opacity: .9; }
.placed-sticker:focus-visible { outline: 2px solid #7a4f2d; outline-offset: 2px; }
.placed-sticker.is-new { animation: sticker-pop .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes sticker-pop { from { opacity: .15; } to { opacity: 1; } }
.sticker-frame { position: absolute; z-index: 4; left: 0; top: 0; width: 10%; aspect-ratio: 1; pointer-events: none; border: 1px dashed #fffaf0; box-shadow: 0 0 0 1px #2c1a0c8c; border-radius: 3px; transform: translate(-50%, -50%); transform-origin: 50% 50%; }
.sticker-frame[hidden] { display: none; }
.sticker-handle { position: absolute; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fffdf6; border: 1.5px solid #6d4728; color: #6d4728; box-shadow: 0 2px 7px #2b1a0e59; pointer-events: auto; touch-action: none; }
.sticker-handle svg { display: block; width: 12px; height: 12px; }
.sticker-handle--rotate { left: 50%; top: 0; transform: translate(-50%, -134%); cursor: grab; }
.sticker-handle--rotate::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 10px; background: #6d4728; transform: translateX(-50%); }
.sticker-handle--scale { right: 0; bottom: 0; transform: translate(50%, 50%); cursor: nwse-resize; }
.sticker-handle:active { background: #ffe7cc; }
.ticket-editable { user-select: none; touch-action: manipulation; }
body.sticker-dragging, body.sticker-dragging * { user-select: none !important; -webkit-user-select: none !important; }
body.sticker-dragging { cursor: grabbing; }
@media (pointer: coarse) {
  .sticker-handle { width: 26px; height: 26px; }
  .sticker-handle svg { width: 14px; height: 14px; }
  .sticker-handle--rotate { transform: translate(-50%, -142%); }
  .sticker-handle--rotate::after { height: 12px; }
}

.ticket-card { background: var(--surface); border: 1px solid var(--line); padding: 8px; border-radius: 6px; min-width: 0; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 4px 1px; color: var(--muted); font-size: .78rem; }
.ticket-meta { align-items: center; }
.delete-link { margin-left: auto; min-height: 34px; color: #8b3124; }
.delete-dialog p { color: var(--muted); }
.ticket-meta .featured { color: var(--accent); font-weight: 800; }

.dialog { margin: auto; overflow: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; width: min(560px, calc(100vw - 26px)); max-height: calc(100dvh - 26px); padding: clamp(18px, 4vw, 30px); }
.result-dialog { width: min(820px, calc(100vw - 28px)); }
.result-dialog h2 { font-size: clamp(1.5rem, 2.3vw, 2.2rem); }
.dialog::backdrop { background: #132c22a6; }
.dialog h2 { font: 900 clamp(1.4rem, 4vw, 2rem)/1.17 var(--serif); padding-right: 39px; margin: 0 0 14px; }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.dialog .ticket { margin-bottom: 12px; }
.coupon { background: #f1e4d6; padding: 14px 17px; border-radius: 5px; border-left: 4px solid var(--accent); }
.coupon p { font-size: .84rem; color: #634935; }
.coupon strong { display: block; margin: 3px 0; }
.coupon code { font: 700 .88rem/1.3 ui-monospace, monospace; overflow-wrap: anywhere; }

/* 抽盲盒：打印机侧向出票（左 → 右） */
.printer-stage { position: relative; margin-bottom: 12px; }
.printer { position: absolute; z-index: 3; left: -24px; top: -3%; bottom: -3%; width: 136px; border: 1px solid #19100b; border-radius: 18px 5px 5px 18px; background: repeating-linear-gradient(90deg, #ffffff0f 0 1px, transparent 1px 6px), linear-gradient(100deg, #4b372c, #1d140f); box-shadow: inset 0 1px 0 #ffffff33, inset -22px 0 30px #00000055, 0 16px 30px #10231b38; }
.printer::after { content: ""; position: absolute; right: -8px; top: 4%; bottom: 4%; width: 9px; border-radius: 0 6px 6px 0; background: linear-gradient(90deg, #c8a678, #7d5730); opacity: .42; }
.printer-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #d8b27a; font: 600 9px/1 var(--sans); letter-spacing: .3em; opacity: .7; writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap; }
.printer-led { position: absolute; left: 50%; top: 22px; margin-left: -4px; width: 8px; height: 8px; border-radius: 50%; background: #8f3a24; box-shadow: 0 0 0 1px #00000059; }
.printer-slot { position: absolute; right: 6px; top: 6%; bottom: 6%; width: 14px; border-radius: 7px 3px 3px 7px; background: linear-gradient(90deg, #050302, #2a1e16); box-shadow: inset 2px 0 6px #000000e0, -1px 0 0 #ffffff26; }
.printer-slot::before, .printer-slot::after { content: ""; position: absolute; left: 3px; width: 7px; height: 7px; border-radius: 50%; background: #6d5540; opacity: .8; }
.printer-slot::before { top: 16px; }
.printer-slot::after { bottom: 16px; }
.printer-paper { position: relative; z-index: 2; }
.printer-paper .ticket { margin-bottom: 0; }
.is-printing .printer { animation: printer-shake .12s linear 16; }
.is-printing .printer-led { background: #e0603a; animation: printer-led .3s steps(2, jump-none) infinite; }
.is-printing .printer-paper { animation: paper-feed 2s cubic-bezier(.4, .02, .25, 1) both; }
.printer-stage .ticket-seal { opacity: 0; }
.printer-stage.is-printed .ticket-seal { animation: seal-stamp .52s cubic-bezier(.2, 1.5, .35, 1) both; }
.printer-stage.is-printed .printer { pointer-events: none; animation: printer-retire .4s ease both; }
.coupon-print { opacity: 0; transform: translateY(8px); }
.coupon-print.is-visible { animation: coupon-in .45s ease both; }

@keyframes printer-shake {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(.7px, -1px); }
  66% { transform: translate(-.7px, 1px); }
}
@keyframes printer-led {
  0% { opacity: .3; box-shadow: 0 0 3px #e0603a; }
  100% { opacity: 1; box-shadow: 0 0 9px 1px #ff7a4a; }
}
@keyframes paper-feed {
  0% { clip-path: inset(0 100% 0 0); }
  12% { clip-path: inset(0 96% 0 0); }
  18% { clip-path: inset(0 92% 0 0); }
  58% { clip-path: inset(0 44% 0 0); }
  66% { clip-path: inset(0 40% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}
@keyframes printer-retire {
  0% { opacity: 1; transform: translateX(0); }
  45% { opacity: 0; transform: translateX(-40px); }
  100% { opacity: 0; transform: translateX(-110px); }
}
@keyframes seal-stamp {
  0% { opacity: 0; transform: translateX(-50%) rotate(-8deg) scale(1.7); }
  55% { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(.94); }
  100% { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1); }
}
@keyframes coupon-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .printer { display: none; }
  .printer-paper { clip-path: none !important; animation: none !important; }
  .printer-stage .ticket-seal { opacity: 1; animation: none !important; }
  .coupon-print { opacity: 1; transform: none; }
}
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-link { display: block; margin-top: 10px; font-size: .85rem; }

@media (max-width: 1000px) {
  .wrap, .activity-main { width: calc(100% - 48px); }
  .site-head { min-height: 67px; }
  .hero-art { width: 46%; right: 3%; }
}
@media (max-width: 700px) {
  .wrap, .activity-main { width: calc(100% - 32px); }
  .site-head { min-height: 63px; }
  .brand-mark { flex-basis: 35px; height: 35px; }
  .head-link { font-size: .82rem; }
  .task-main { padding-top: 14px; }
  .task-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
  .task-center { grid-column: 1 / -1; grid-row: 1; padding-bottom: 10px; }
  .task-center h1 { font-size: clamp(2.1rem, 8.45vw, 3.6rem); }
  .photo-frame { height: clamp(132px, 35vw, 239px); }
  .editorial figcaption { padding: 8px 0 6px; }
  .photo-label { top: 7px; left: 7px; padding: 2px 6px; }
  .participate { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .participate > .button { justify-self: start; }
  .activity-hero { grid-template-columns: minmax(0, 1fr); gap: 9px; margin-top: 19px; }
  .hero-create, .hero-draw { padding: 18px; min-height: 0; }
  .activity-hero .button { margin-top: 13px; min-width: 0; }
  .hero-art { width: 40%; right: 3%; }
  .hero-ticket-copy strong { font-size: clamp(.66rem, 3.6vw, 1.4rem); }
  .hero-draw::after { right: -16px; bottom: -35px; }
  .collection { margin-top: 28px; }
  .editor-grid { display: flex; flex-direction: column-reverse; align-items: stretch; }
  .editor-preview { position: static; }
  .sticker-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 355px) {
  .activity-heading h1 { font-size: 1.78rem; }
  .hero-art { width: 36%; }
  .participate { grid-template-columns: 1fr; }
  .tab { padding-inline: 2px; font-size: .82rem; }
  .hero-create h2 { font-size: 1.65rem; }
}

