/* 空投 · ouyz.me/airdrop/ —— 与主页同一片夜空，但这里是一间陈列室：
   字要立得住（无衬线、够大、够亮），箱子要有分量（分面打光 + 光晕）。
   金 = 宝物；青 = 仪表；紫 = 途中。 */

@font-face {
  font-family: "OUYZ Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/type.woff2") format("woff2");
  unicode-range: U+2E, U+4F, U+55, U+59, U+5A;
}

:root {
  --ink: #f4f3f0;
  --muted: rgba(244, 243, 240, 0.7);
  --faint: rgba(244, 243, 240, 0.42);
  --gold: 231, 197, 133;      /* 宝物的光 */
  --cyan: 138, 216, 234;      /* HUD 的光 */
  --violet: 158, 145, 255;    /* 主页的紫，留给「途中」 */
  --accent: var(--gold);
  --display: "OUYZ Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: #050507;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 34%, #0b0b0f 0%, #060608 52%, #040404 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 静态胶片颗粒：比主页更轻，别把字蒙脏 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
[type="text"]:focus-visible,
[role="button"]:focus-visible {
  outline: 1px solid rgba(var(--accent), 0.85);
  outline-offset: 5px;
  border-radius: 3px;
}

::selection { background: rgba(var(--gold), 0.28); color: var(--ink); }

/* 途中（预告）：灯光换成紫 */
body[data-state="scheduled"] { --accent: var(--violet); }
body[data-kind="user"] { --accent: var(--cyan); }

body[data-kind="user"] .top__tag::before {
  border-color: rgba(var(--cyan), 0.85);
}

body[data-kind="user"] .tint {
  background: radial-gradient(52% 44% at 50% 42%, rgba(var(--cyan), 0.12), transparent 70%);
}

/* ── 氛围层 ─────────────────────────────────────────────── */

.ether {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.tint {
  position: fixed;
  inset: -12%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(52% 44% at 50% 42%, rgba(var(--gold), 0.12), transparent 70%);
  transition: opacity 2400ms ease;
}

body.lit .tint { opacity: 1; transition-duration: 260ms; }

/* ── 顶栏 ───────────────────────────────────────────────── */

.top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.2rem, 3vh, 2rem) clamp(1.3rem, 4vw, 2.6rem) 0;
  animation: fade 800ms 80ms ease both;
}

.top__home {
  font-family: var(--display);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: rgba(244, 243, 240, 0.94);
  transition: color 240ms ease;
}

.top__home:hover { color: #fff; }

.top__dot {
  display: inline-block;
  width: 0.22em;
  height: 0.22em;
  margin-left: 0.1em;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, rgba(214, 202, 255, 0.9), rgba(122, 106, 255, 0.55));
  box-shadow: 0 0 6px rgba(154, 140, 255, 0.55);
}

/* 右上角的自投入口：一枚安静的小字，和货运牌同属一个整体 */
.top__side {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.6vw, 1.5rem);
}

.top__drop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(244, 243, 240, 0.44);
  transition: color 200ms ease;
}

.top__drop::before {
  content: "+";
  margin-right: 0.5em;
  color: rgba(var(--accent), 0.6);
  font-size: 0.75rem;
  line-height: 1;
}

.top__drop:hover { color: rgba(255, 255, 255, 0.95); }

/* 钥匙徽记的挂载位：内容由 key.js 渲染，这里只定它的尺度 */
.top__key {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: rgba(244, 243, 240, 0.44);
}

.top__key:empty { display: none; }

/* 货运标签式徽标：带金色角标的边框牌 */
.top__tag {
  position: relative;
  margin: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  padding: 0.52em 0.9em 0.5em;
  border: 1px solid rgba(244, 243, 240, 0.22);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.015);
}

.top__tag::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 7px;
  height: 7px;
  border-top: 2px solid rgba(var(--gold), 0.85);
  border-left: 2px solid rgba(var(--gold), 0.85);
}

.top__tag b {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: rgba(255, 255, 255, 0.92);
}

.top__tag i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.46rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(var(--cyan), 0.66);
}

/* ── 房间主体 ───────────────────────────────────────────── */

.room {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(44rem, 100%);
  margin: 0 auto;
  padding: 0 22px clamp(3rem, 6vh, 4.4rem);
}

/* ── 舞台 ───────────────────────────────────────────────── */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1.6rem, 5vh, 3.4rem);
  animation: rise 900ms 160ms cubic-bezier(0.18, 0.75, 0.2, 1) both;
}

.stage__frame {
  position: relative;
  width: clamp(250px, 68vw, 340px);
  height: clamp(250px, 68vw, 340px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body[data-state="none"] .stage__frame,
body[data-state="scheduled"] .stage__frame,
body[data-state="exhausted"] .stage__frame,
body[data-state="loading"] .stage__frame,
body[data-state="gone"] .stage__frame,
body[data-state="error"] .stage__frame,
body[data-state="entry"][data-entered] .stage__frame { cursor: default; }

body[data-state="gone"] .stage { display: none; }

/* HUD 括角 */
.stage__brackets {
  position: absolute;
  inset: 1.5%;
  pointer-events: none;
  --hudc: rgba(var(--cyan), 0.4);
  background:
    linear-gradient(var(--hudc) 0 0) left top / 14px 1px,
    linear-gradient(var(--hudc) 0 0) left top / 1px 14px,
    linear-gradient(var(--hudc) 0 0) right top / 14px 1px,
    linear-gradient(var(--hudc) 0 0) right top / 1px 14px,
    linear-gradient(var(--hudc) 0 0) left bottom / 14px 1px,
    linear-gradient(var(--hudc) 0 0) left bottom / 1px 14px,
    linear-gradient(var(--hudc) 0 0) right bottom / 14px 1px,
    linear-gradient(var(--hudc) 0 0) right bottom / 1px 14px;
  background-repeat: no-repeat;
}

/* 遥测角标 */
.hud {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: rgba(var(--cyan), 0.72);
  white-space: nowrap;
  pointer-events: none;
}

.hud--tl { top: -1.7em; left: 1%; }
.hud--tr { top: -1.7em; right: 1%; letter-spacing: 0.2em; }

/* 画布探出舞台 */
.stage__art {
  position: absolute;
  left: -40%;
  right: -40%;
  top: -62%;
  bottom: -26%;
  width: 180%;
  height: 188%;
  pointer-events: none;
}

/* 按住时的进度环 */
.stage__ring {
  position: absolute;
  inset: 6%;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.stage__ring circle {
  fill: none;
  stroke: rgba(var(--accent), 0.8);
  stroke-width: 0.8;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke-linecap: round;
}

body.charging .stage__ring { opacity: 1; }

.stage__hint {
  min-height: 1.4em;
  margin: 1.9rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  color: rgba(244, 243, 240, 0.85);
  text-align: center;
  transition: color 400ms ease;
}

.stage__hint.warn { color: rgba(240, 178, 148, 0.95); }

/* 人机验证：后端配了 Turnstile 才露面，安置在提示与本箱信息之间 */
.stage__verify {
  position: relative;   /* 抬到探出舞台的画布之上 */
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 65px;     /* 先把位置占住，widget 落位时不顶动下面的信息 */
  margin: 1.15rem 0 0.1rem;
  animation: fade 600ms ease both;
}

/* Turnstile 有时会给容器写 display，藏就得藏得住 */
#verify[hidden] { display: none !important; }

/* 官方脚本没能到场：留一句话，别空着一块 */
.stage__verify--dead {
  min-height: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(240, 178, 148, 0.85);
  text-align: center;
}

/* ── 本箱信息 ───────────────────────────────────────────── */

.meta {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: clamp(1.4rem, 3vh, 2rem);
  text-align: center;
  animation: rise 800ms 100ms cubic-bezier(0.18, 0.75, 0.2, 1) both;
}

body[data-state="live"] .meta,
body[data-state="entry"] .meta,
body[data-state="opening"] .meta,
body[data-state="claimed"] .meta,
body[data-state="exhausted"] .meta,
body[data-state="scheduled"] .meta { display: flex; }

.meta__title {
  max-width: min(100%, 36rem);
  margin: 0;
  font-size: clamp(1.35rem, 4.6vw, 1.75rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  color: rgba(255, 255, 255, 0.96);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta__note {
  margin: 0.8rem 0 0;
  max-width: 30rem;
  font-size: 0.88rem;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-wrap: balance;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta__note:empty { display: none; }

/* 倒计时（途中） */
.meta__count {
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 5.6vw, 2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: rgba(222, 215, 255, 0.95);
  text-shadow: 0 0 24px rgba(var(--violet), 0.4);
}

body[data-kind="user"] .meta__count {
  color: rgba(211, 248, 255, 0.95);
  text-shadow: 0 0 24px rgba(var(--cyan), 0.4);
}

/* 报名倒计时指向开奖，箱子已经在台上：跟着宝物的金走 */
body[data-state="entry"] .meta__count {
  color: rgba(255, 240, 214, 0.95);
  text-shadow: 0 0 24px rgba(var(--gold), 0.32);
}

/* 供给条：一段一份 */
.supply {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px;
  max-width: 22rem;
  margin-top: 1.3rem;
}

.supply .seg {
  width: 18px;
  height: 6px;
  transform: skewX(-18deg);
  background: rgba(244, 243, 240, 0.12);
}

.supply .seg.lit {
  background: linear-gradient(90deg, rgba(255, 233, 194, 0.98), rgba(var(--gold), 0.85));
  box-shadow: 0 0 9px rgba(var(--gold), 0.5);
}

.supply .seg.dim {
  background: linear-gradient(90deg, rgba(224, 216, 255, 0.95), rgba(var(--violet), 0.7));
  box-shadow: 0 0 9px rgba(var(--violet), 0.45);
}

.supply .count {
  margin-left: 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(244, 243, 240, 0.78);
  white-space: nowrap;
}

/* 品目：箱子里有什么 */
.meta__items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.55rem;
  max-width: 30rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.meta__items li {
  padding: 0.36em 0.95em;
  border: 1px solid rgba(244, 243, 240, 0.17);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(244, 243, 240, 0.8);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.02);
}

.meta__items li b {
  font-weight: 500;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: rgba(var(--accent), 0.9);
}

.meta__items li.gone {
  opacity: 0.4;
  border-style: dashed;
  background: none;
}

.meta__items li.gone b { color: var(--faint); }

/* 签已在箱里：一行安静的回执，票卡要等开奖 */
.entry-note {
  margin: 1.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  color: rgba(var(--gold), 0.72);
}

.entry-note::before {
  content: "◈";
  margin-right: 0.6em;
  opacity: 0.75;
}

/* 用户自投箱：只展示整体供给，不公开箱内品目 */
body[data-kind="user"] .meta__items,
body[data-kind="user"] .meta__next,
body[data-kind="user"] .ledger { display: none !important; }

body[data-kind="user"] .supply .seg.lit {
  background: linear-gradient(90deg, rgba(204, 247, 255, 0.98), rgba(var(--cyan), 0.82));
  box-shadow: 0 0 9px rgba(var(--cyan), 0.48);
}

body[data-kind="user"] .supply .seg.dim {
  background: linear-gradient(90deg, rgba(204, 247, 255, 0.9), rgba(var(--cyan), 0.66));
  box-shadow: 0 0 9px rgba(var(--cyan), 0.4);
}

/* 投箱人署名：一行安静的落款，而不是一块公告牌 */
.user-box {
  width: min(32rem, 100%);
  margin-top: 1.3rem;
  text-align: center;
}

.user-box__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
}

.user-box__line b {
  min-width: 0;
  max-width: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: 0.08em;
  color: rgba(238, 253, 255, 0.9);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 「投下」是动词不是名字：退成常规字重，让长署名结尾干净 */
.user-box__verb {
  margin-left: -0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.user-box__line i {
  align-self: center;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(var(--cyan), 0.5);
}

.user-box__burn {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(var(--cyan), 0.66);
  white-space: nowrap;
}

.user-box__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 0.9rem;
  min-height: 2rem;
  margin: 0.3rem 0 0;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.user-box__foot span { color: var(--muted); }

.text-button {
  appearance: none;
  border: 0;
  padding: 0.55rem 0;
  background: none;
  color: rgba(var(--accent), 0.72);
  font: 500 0.68rem/1.4 var(--sans);
  letter-spacing: 0.1em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent), 0.24);
  text-underline-offset: 0.28em;
}

.text-button:hover { color: rgba(var(--accent), 1); }
.text-button:disabled { opacity: 0.48; cursor: default; }
.text-button--danger { color: rgba(238, 174, 154, 0.72); text-decoration-color: rgba(238, 174, 154, 0.28); }
.text-button--danger:hover { color: rgba(248, 197, 181, 0.96); }

/* 台上这箱之外还有预告：让它像一枚正在逼近的信标，而不是一行脚注 */
.meta__next {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  width: min(32rem, 100%);
  margin: 1.35rem 0 0;
  padding: 0.8rem 0.95rem;
  overflow: hidden;
  border: 1px solid rgba(var(--violet), 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(var(--violet), 0.12), rgba(var(--violet), 0.035)),
    rgba(9, 8, 15, 0.82);
  text-align: left;
  box-shadow:
    inset 0 1px rgba(232, 228, 255, 0.05),
    0 0 30px rgba(var(--violet), 0.08);
  animation: next-arrive 700ms cubic-bezier(0.18, 0.75, 0.2, 1) both;
}

.meta__next[hidden] { display: none; }

.meta__next::after {
  content: "";
  position: absolute;
  right: -2rem;
  top: -3rem;
  width: 8rem;
  height: 8rem;
  border: 1px solid rgba(var(--violet), 0.11);
  border-radius: 50%;
  pointer-events: none;
}

.meta__next-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--violet));
  box-shadow:
    0 0 0 5px rgba(var(--violet), 0.1),
    0 0 18px rgba(var(--violet), 0.72);
  animation: next-beacon 1.8s ease-in-out infinite;
}

.meta__next-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.3rem;
}

.meta__next-kicker {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(207, 199, 255, 0.78);
}

.meta__next-copy strong {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.94);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta__next-time {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.07em;
  color: rgba(222, 215, 255, 0.82);
  white-space: nowrap;
}

@keyframes next-beacon {
  0%, 100% { opacity: 0.55; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes next-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── 空舞台 ─────────────────────────────────────────────── */

.empty {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1.3rem, 2.8vh, 1.9rem);
  text-align: center;
  animation: rise 800ms 120ms cubic-bezier(0.18, 0.75, 0.2, 1) both;
}

body[data-state="none"] .empty,
body[data-state="error"] .empty { display: flex; }

.empty__line {
  margin: 0;
  font-size: clamp(1.1rem, 3.8vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: rgba(255, 255, 255, 0.94);
}

.empty__sub {
  margin: 0.95rem 0 0;
  font-size: 0.88rem;
  line-height: 1.9;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.empty__last {
  margin: 1.3rem 0 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--faint);
  max-width: 100%;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.empty__last:empty { display: none; }

/* 许愿池只在官方空场出现 */
.wish {
  width: min(30rem, 100%);
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(244, 243, 240, 0.1);
  text-align: left;
}

.wish__label {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.86);
}

.wish__entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.wish__entry input {
  min-width: 0;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid rgba(244, 243, 240, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font: 0.86rem var(--sans);
}

.wish__entry input::placeholder { color: var(--faint); }
.wish__entry input:disabled { opacity: 0.5; }

.wish__entry button {
  appearance: none;
  min-width: 4.4rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid rgba(var(--gold), 0.35);
  border-radius: 7px;
  background: rgba(var(--gold), 0.08);
  color: rgba(255, 236, 202, 0.92);
  font: 600 0.74rem var(--sans);
  letter-spacing: 0.12em;
  cursor: pointer;
}

.wish__entry button:disabled { opacity: 0.45; cursor: default; }

.wish__status {
  min-height: 1.4em;
  margin: 0.65rem 0 0;
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--muted);
}

.wish-list {
  width: min(30rem, 100%);
  margin-top: 1.35rem;
  text-align: left;
}

.wish-list h3 {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--faint);
}

.wish-list ul {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.wish-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid rgba(244, 243, 240, 0.065);
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(244, 243, 240, 0.75);
}

.wish-list li span { overflow-wrap: anywhere; }
.wish-list time { flex: 0 0 auto; font: 0.56rem var(--mono); color: var(--faint); }

#wishEmpty {
  margin: 0.7rem 0 0;
  font-size: 0.72rem;
  color: var(--faint);
}

/* 用户箱离场：归宿而不是报错 */
.gone {
  display: none;
  flex-direction: column;
  align-items: center;
  width: min(32rem, 100%);
  margin-top: clamp(5rem, 16vh, 9rem);
  text-align: center;
  animation: rise 700ms ease both;
}

body[data-state="gone"] .gone { display: flex; }

.gone h2 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.gone > p {
  margin: 0.9rem 0 0;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gone__door {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 1.1rem;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: rgba(var(--cyan), 0.66);
  transition: color 200ms ease;
}

.gone__door:hover { color: #fff; }

/* ── 票卡 ───────────────────────────────────────────────── */

.claim {
  display: none;
  width: 100%;
  margin-top: clamp(1.9rem, 4vh, 2.8rem);
  animation: ticket-rise 900ms 80ms cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

body[data-state="claimed"] .claim { display: block; }

.ticket {
  position: relative;
  width: min(34rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.7rem 1.35rem;
  border: 1px solid rgba(var(--accent), 0.26);
  border-radius: 10px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(var(--accent), 0.06), transparent 55%),
    linear-gradient(180deg, rgba(21, 19, 14, 0.9), rgba(10, 10, 9, 0.95));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 0.5px rgba(255, 240, 210, 0.3),
    0 0 42px rgba(var(--accent), 0.06);
}

.ticket__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: rgba(var(--accent), 0.82);
}

/* 名目占一行，动作缩到行尾：省掉一整排按钮，卡也就短了一截 */
.ticket__line {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-top: 1rem;
}

.ticket__label {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.2rem, 4.2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.96);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ticket__secret {
  position: relative;
  margin-top: 0.8rem;
  border: 1px dashed rgba(var(--accent), 0.2);
  border-radius: 7px;
  background: rgba(5, 5, 4, 0.75);
  overflow: hidden;
}

.ticket__secret pre {
  margin: 0;
  padding: 0.95rem 1.05rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #ffedc9;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  transition: filter 300ms ease, opacity 300ms ease;
}

.ticket__veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.ticket__secret.veiled pre { filter: blur(9px); opacity: 0.5; user-select: none; -webkit-user-select: none; }
.ticket__secret.veiled .ticket__veil { opacity: 1; pointer-events: auto; cursor: pointer; }

body[data-kind="user"] .ticket {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(var(--cyan), 0.07), transparent 55%),
    linear-gradient(180deg, rgba(14, 20, 21, 0.92), rgba(8, 11, 12, 0.96));
}

body[data-kind="user"] .ticket__secret pre { color: rgba(211, 248, 255, 0.96); }

.ticket__tools {
  flex: 0 0 auto;
  display: flex;
  gap: 0.1rem;
  /* 名目是中西混排，视觉重心比行盒中线低一点，图标跟着往下坐一点才对齐 */
  margin-top: 0.12rem;
}

.ticket__tools button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: none;
  color: rgba(244, 243, 240, 0.3);
  cursor: pointer;
  transition: color 200ms ease, background-color 200ms ease;
}

.ticket__tools button:hover {
  color: rgba(var(--accent), 0.9);
  background: rgba(var(--accent), 0.07);
}

.ticket__tools .i {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 两枚图标叠在同一格里，靠状态换脸，不改 DOM */
.ticket__tools .i-done,
.ticket__tools .i-eyeoff { display: none; }

#btnCopy.done { color: rgba(var(--accent), 0.95); }
#btnCopy.done .i-copy { display: none; }
#btnCopy.done .i-done { display: block; }

#btnVeil[aria-pressed="true"] { color: rgba(var(--accent), 0.72); }
#btnVeil[aria-pressed="true"] .i-eye { display: none; }
#btnVeil[aria-pressed="true"] .i-eyeoff { display: block; }

/* 票据上的动作要退后：小、淡，凑近才被注意到 */
.btn {
  appearance: none;
  padding: 0.42em 0.95em;
  border: 1px solid rgba(244, 243, 240, 0.13);
  border-radius: 999px;
  background: transparent;
  color: rgba(244, 243, 240, 0.5);
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  cursor: pointer;
  transition: border-color 240ms ease, color 240ms ease, transform 120ms ease;
}

.btn:hover { border-color: rgba(244, 243, 240, 0.34); color: rgba(244, 243, 240, 0.88); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.done { border-color: rgba(var(--accent), 0.5); color: rgba(var(--accent), 0.9); }

/* 撕票线 */
.ticket__mates {
  position: relative;
  margin: 1.25rem -1.7rem 0;
  padding: 1.05rem 1.7rem 0;
  border-top: 1px dashed rgba(244, 243, 240, 0.16);
  font-size: 0.8rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ticket__mates:empty { display: none; }

.ticket__mates::before,
.ticket__mates::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #050506;
}

.ticket__mates::before { left: -8px; }
.ticket__mates::after { right: -8px; }

/* 一小段「条码」——票的出身。压到只在凑近时才被看见 */
.ticket__bar {
  display: block;
  width: 84px;
  height: 10px;
  margin: 0.9rem auto 0;
  opacity: 0.26;
  background: repeating-linear-gradient(
    90deg,
    rgba(var(--accent), 0.9) 0 1px,
    transparent 1px 3px,
    rgba(var(--accent), 0.5) 3px 5px,
    transparent 5px 8px,
    rgba(var(--accent), 0.9) 8px 9px,
    transparent 9px 12px
  );
}

.ticket__from {
  margin: 0.45rem 0 0;
  font-family: var(--mono);
  font-size: 0.55rem;
  line-height: 1.7;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--faint);
  opacity: 0.72;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ── 投箱人管理 ─────────────────────────────────────────── */

.manage {
  width: min(34rem, 100%);
  margin-top: clamp(2.2rem, 5vh, 3.3rem);
  padding: 1.25rem;
  border: 1px solid rgba(var(--cyan), 0.22);
  border-radius: 10px;
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(var(--cyan), 0.05), transparent 68%),
    rgba(7, 12, 13, 0.88);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
  animation: rise 700ms ease both;
}

.manage__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.manage__head p {
  margin: 0;
  font: 600 0.54rem var(--mono);
  letter-spacing: 0.24em;
  color: rgba(var(--cyan), 0.62);
}

.manage__head h2 {
  margin: 0.45rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.manage__head > span {
  flex: 0 0 auto;
  font: 600 0.68rem var(--mono);
  letter-spacing: 0.12em;
  color: rgba(var(--cyan), 0.82);
}

.manage__status {
  min-height: 1.4em;
  margin: 0.8rem 0 0;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--faint);
}

.manage__share,
.manage__progress,
.manage__claims,
.manage__actions {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(244, 243, 240, 0.08);
}

.manage__share > label,
.manage__progress span,
.manage__claims h3 {
  display: block;
  margin: 0;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.manage__share > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.manage__share input {
  min-width: 0;
  min-height: 40px;
  padding: 0 0.75rem;
  border: 1px solid rgba(var(--cyan), 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(223, 247, 251, 0.78);
  cursor: copy;
  font: 0.68rem var(--mono);
}

.manage__progress > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.manage__progress strong {
  font: 600 0.72rem var(--mono);
  color: rgba(var(--cyan), 0.88);
}

.manage__progress progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 0.7rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(244, 243, 240, 0.09);
  color: rgb(var(--cyan));
}

.manage__progress progress::-webkit-progress-bar { background: rgba(244, 243, 240, 0.09); }
.manage__progress progress::-webkit-progress-value { background: rgb(var(--cyan)); box-shadow: 0 0 10px rgba(var(--cyan), 0.45); }
.manage__progress progress::-moz-progress-bar { background: rgb(var(--cyan)); box-shadow: 0 0 10px rgba(var(--cyan), 0.45); }

.manage__claims ol {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.manage__claims li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(244, 243, 240, 0.06);
}

.manage__claims time {
  font: 0.56rem var(--mono);
  color: var(--faint);
  white-space: nowrap;
}

.manage__claims li span {
  overflow-wrap: anywhere;
  font-size: 0.75rem;
  color: rgba(244, 243, 240, 0.78);
}

.manage__claims code {
  font: 0.6rem var(--mono);
  letter-spacing: 0.08em;
  color: rgba(var(--cyan), 0.68);
}

#manageEmpty {
  margin: 0.7rem 0 0;
  font-size: 0.72rem;
  color: var(--faint);
}

.manage__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.9rem;
}

.manage__action { min-width: 0; }

.manage__confirm {
  margin-top: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(var(--cyan), 0.18);
  border-radius: 7px;
  background: rgba(var(--cyan), 0.035);
}

.manage__confirm--danger {
  border-color: rgba(238, 174, 154, 0.2);
  background: rgba(238, 174, 154, 0.035);
}

.manage__confirm p {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--muted);
}

.manage__confirm > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.btn--firm { border-color: rgba(var(--cyan), 0.34); color: rgba(216, 246, 251, 0.88); }
.btn--danger { border-color: rgba(238, 174, 154, 0.34); color: rgba(248, 197, 181, 0.9); }

/* ── 往期 ───────────────────────────────────────────────── */

.ledger {
  display: none;
  width: min(34rem, 100%);
  margin-top: clamp(2.6rem, 6vh, 3.8rem);
  animation: fade 900ms 200ms ease both;
}

.ledger.on { display: block; }

/* 账本入口本身就是一行字：点开才见旧账 */
.ledger__head {
  appearance: none;
  display: block;
  margin: 0 auto 0.45rem;
  border: 0;
  padding: 0.6rem 1rem;
  background: none;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-align: center;
  color: rgba(244, 243, 240, 0.42);
  cursor: pointer;
  transition: color 180ms ease;
}

.ledger__head::after { content: " ▾"; font-size: 0.55rem; }
.ledger__head[aria-expanded="true"]::after { content: " ▴"; }
.ledger__head:hover { color: rgba(var(--gold), 0.85); }

.ledger__rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ledger__rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.75rem 0.15rem;
  border-bottom: 1px solid rgba(244, 243, 240, 0.07);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* 你在往期领过的：一枚很轻的展开器 */
.ledger__rows .yours {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: rgba(var(--gold), 0.6);
  border-bottom: 1px dotted rgba(var(--gold), 0.4);
  cursor: pointer;
  transition: color 200ms ease;
}

.ledger__rows .yours:hover { color: rgba(255, 233, 196, 0.95); }

.ledger__mine {
  flex-basis: 100%;
  margin: 0.25rem 0 0.2rem;
  padding: 0.7rem 0.9rem 0.75rem;
  border: 1px dashed rgba(var(--gold), 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.015);
}

.ledger__mine i {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.ledger__mine pre {
  margin: 0.45rem 0 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.75;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  word-break: break-all;
  color: rgba(255, 236, 204, 0.92);
}

.ledger__rows .seq {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: rgba(var(--gold), 0.66);
}

.ledger__rows .name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: rgba(244, 243, 240, 0.85);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ledger__rows .fate {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  white-space: nowrap;
}

.ledger__rows li.missed .fate { color: rgba(240, 178, 148, 0.78); }

/* ── 门 ─────────────────────────────────────────────────── */

.doors {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0 22px calc(max(3.4vh, 18px) + env(safe-area-inset-bottom, 0px));
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  animation: fade 900ms 420ms ease both;
}

.doors a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32rem;
  transition: color 240ms ease;
}

.doors a span {
  color: var(--faint);
  font-size: 12px;
  transition: color 240ms ease, transform 240ms ease;
}

.doors a:hover { color: var(--ink); }
.doors a:hover span { color: rgb(var(--gold)); transform: translate(1px, -1px); }

.noscript {
  position: relative;
  z-index: 3;
  margin: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── 动画 ───────────────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes ticket-rise {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── 窄窗口 ─────────────────────────────────────────────── */

@media (max-width: 560px) {
  .ticket { padding: 1.3rem 1.15rem 1.15rem; }
  .ticket__mates { margin: 1.15rem -1.15rem 0; padding: 0.95rem 1.15rem 0; }
  .meta__next { grid-template-columns: auto minmax(0, 1fr); gap: 0.72rem; }
  .meta__next-time { grid-column: 2; margin-top: -0.1rem; white-space: normal; }
  .wish__entry { grid-template-columns: minmax(0, 1fr) 4.2rem; }
  .wish-list li { gap: 0.65rem; }
  .manage { padding: 1rem; }
  .manage__share > div { grid-template-columns: minmax(0, 1fr); }
  .manage__share .btn { justify-self: start; }
  .manage__claims li {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.7rem;
  }
  .manage__claims time { grid-column: 1 / -1; }
  .manage__actions { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
  .doors { gap: 1.6rem; font-size: 12.5px; }
  .hud { font-size: 0.52rem; }
}

@media (pointer: coarse) {
  .btn,
  .text-button,
  .ledger__head {
    min-height: 44px;
  }

  /* 图标按钮要够手指点，但别把行撑开：横向长到 44，纵向留给行高 */
  .ticket__tools button {
    width: 44px;
    height: 38px;
  }
}

/* 再窄一点：Turnstile 的 widget 固定 300px，缩一档免得被裁掉边 */
@media (max-width: 360px) {
  .stage__verify { transform: scale(0.88); transform-origin: center top; }
  .top__side { gap: 0.7rem; }
  .top__drop { letter-spacing: 0.12em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
