/* 点击不出现浏览器的蓝色高亮块 / 聚焦框（键盘 Tab 才显示聚焦环） */
* { -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }
:root {
  --night: #0b1615;
  --deep: #102120;
  --panel: rgba(18, 34, 32, .78);
  --line: rgba(211, 172, 117, .22);
  --cream: #f3ecdf;
  --muted: #9fb0a6;
  --gold: #d3ac75;
  --gold-hi: #ecd1a2;
  --wine: #7d3b3b;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --col: 560px;
  --close: 0; /* 0→1：随滚动两个人慢慢靠近 */
  /* 工牌底图上的落位（百分比），与 badge-blank.jpg 对齐，canvas 导出共用 */
  --badge-photo-top: 40.7;
  --badge-photo-w: 53;
  --badge-info-top: 71.5;
  --badge-no-bottom: 3.6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--night); color: var(--cream); font: 16px/1.75 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── 两个人 ───────────────────────── */
.pair { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.pair img { position: absolute; bottom: 0; height: 100vh; width: auto; max-width: none; object-fit: cover; transition: transform .2s linear; }
.pair-gu { left: -6vw; -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 92%); mask-image: linear-gradient(90deg, #000 45%, transparent 92%); }
.pair-lin { right: -6vw; -webkit-mask-image: linear-gradient(270deg, #000 45%, transparent 92%); mask-image: linear-gradient(270deg, #000 45%, transparent 92%); }
/* 滚动靠近：用 transform 同时作用在原图和景深画布（canvas 紧跟在 img 后面），两者始终重合，不会出现错位的虚影 */
.pair-gu, .pair-gu + .depth-portrait { transform: translateX(calc(var(--close) * 4vw)); }
.pair-lin, .pair-lin + .depth-portrait { transform: translateX(calc(var(--close) * -4vw)); }
.pair img, .pair .depth-portrait { transition: none; }
.pair-glow { position: absolute; left: 50%; top: 30%; width: 70vw; height: 70vh; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(211, 172, 117, calc(.08 + var(--close) * .1)), transparent); }
.pair::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 34% 100% at 50% 50%, rgba(11, 22, 21, .82), rgba(11, 22, 21, .25) 70%, transparent); }

/* ── 顶栏 ───────────────────────── */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: calc(var(--col) + 80px); margin: 0 auto; padding: 14px 20px; background: linear-gradient(var(--night) 40%, transparent); }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); letter-spacing: .08em; }
.seal { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--gold); color: var(--gold); font-size: 15px; border-radius: 3px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 8px 12px; font-size: 14px; color: var(--muted); text-decoration: none; border-radius: 999px; }
.topbar nav a:hover { color: var(--cream); background: rgba(243, 236, 223, .06); }

main { position: relative; z-index: 1; max-width: var(--col); margin: 0 auto; padding: 0 20px; }

/* ── 开场 ───────────────────────── */
.opening { min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: center; padding: 24px 0 64px; text-align: center; }
.chat-open { display: flex; flex-direction: column; gap: 8px; margin: 0 auto 40px; width: min(100%, 340px); }
.chat-time { margin: 0 0 4px; font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.bubble { margin: 0; max-width: 82%; padding: 9px 14px; font-size: 14px; line-height: 1.55; border-radius: 16px; text-align: left; opacity: 0; animation: pop .5s ease forwards; }
.from-lin { align-self: flex-end; background: var(--cream); color: #1a2422; border-bottom-right-radius: 4px; animation-delay: .4s; }
.from-gu { align-self: flex-start; background: #1c2f2c; border: 1px solid var(--line); border-bottom-left-radius: 4px; animation-delay: 1.5s; }
.from-gu.delay { animation-delay: 2.5s; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
h1 { margin: 0; font: 400 clamp(52px, 13vw, 84px)/1.08 var(--serif); letter-spacing: .06em; text-shadow: 0 2px 30px rgba(0, 0, 0, .6); }
.names { margin: 18px 0 0; font-family: var(--serif); color: var(--gold); letter-spacing: .3em; }
.names i { font-style: normal; color: var(--muted); padding: 0 .3em; }
.lede { margin: 16px 0 32px; color: var(--muted); font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.resume { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--gold); }

.btn { white-space: nowrap; flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: 999px; text-decoration: none; font-size: 15px; letter-spacing: .04em; cursor: pointer; border: 1px solid transparent; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1408; font-weight: 600; }
.btn.line { border-color: var(--line); background: rgba(11, 22, 21, .5); }
.btn.small { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ── 区块 ───────────────────────── */
.block { padding: 72px 0; text-align: center; }
.kicker { margin: 0 0 10px; font-size: 12px; letter-spacing: .32em; color: var(--gold); }
h2 { margin: 0; font: 400 clamp(28px, 7vw, 36px)/1.35 var(--serif); letter-spacing: .04em; }
.sub { margin: 14px 0 32px; color: var(--muted); font-size: 14px; }
.hint { min-height: 1.4em; margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* ── 工牌 ───────────────────────── */
.badges { display: grid; grid-template-columns: 1fr 1.18fr 1fr; align-items: end; gap: 10px; margin: 8px 0 36px; }
.badge { position: relative; aspect-ratio: 500 / 945; background: center / 100% 100% no-repeat; color: #1b2624; text-align: center; container-type: inline-size; }
.badge.has-art { background-image: url(assets/badge-blank.webp); }
.badge .photo { position: absolute; top: calc(var(--badge-photo-top) * 1%); left: 50%; transform: translateX(-50%); width: calc(var(--badge-photo-w) * 1%); aspect-ratio: 1; object-fit: cover; border-radius: 3%; background: #c9c2b5; }
.badge .photo.initial { display: grid; place-items: center; font: 400 18cqi var(--serif); color: #4a5753; }
.badge .info { position: absolute; top: calc(var(--badge-info-top) * 1%); left: 12%; right: 12%; }
.badge .nick { display: block; font: 600 9.5cqi/1.25 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge .title { display: block; margin-top: 2cqi; font-size: 5.6cqi; letter-spacing: .12em; color: #6b5a3a; }
.badge .days { display: block; margin-top: 1.5cqi; font-size: 5cqi; color: #6d7774; }
.badge .no { position: absolute; bottom: calc(var(--badge-no-bottom) * 1%); left: 0; right: 0; font: 5cqi var(--serif); letter-spacing: .2em; color: #8f8574; }
.badges .badge:nth-child(2) { transform: translateY(-18px); }
.badges .badge:nth-child(2)::before { content: ""; position: absolute; inset: 20% -18% -6%; z-index: -1; background: radial-gradient(closest-side, rgba(211, 172, 117, .35), transparent); }
.badges .badge:nth-child(2)::after { content: "在职最久"; position: absolute; top: 36%; left: 50%; transform: translateX(-50%); padding: 0 8px; font-size: 5cqi; letter-spacing: .1em; color: var(--gold-hi); white-space: nowrap; }
.badges .badge:nth-child(1), .badges .badge:nth-child(3) { transform: rotate(-2deg); }
.badges .badge:nth-child(3) { transform: rotate(2deg); }

.finder { margin: 0 auto 32px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); backdrop-filter: blur(10px); }
.finder label { display: block; margin-bottom: 12px; font-family: var(--serif); font-size: 18px; }
.finder-row { display: flex; gap: 8px; }
input, textarea { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(11, 22, 21, .7); color: var(--cream); }
input::placeholder, textarea::placeholder { color: #6f817a; }
.my-badge { width: min(240px, 70%); margin: 18px auto 0; }
.my-badge .btn { margin-top: 14px; width: 100%; }

.roster-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; text-align: left; }
.member { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 4px; border-bottom: 1px solid rgba(243, 236, 223, .06); font-size: 14px; }
.member .r { width: 28px; font: 12px var(--serif); color: var(--muted); text-align: right; flex: none; }
.member img, .member .ph { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; background: #1f3330; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.member .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .d { font-size: 12px; color: var(--muted); flex: none; }
.member.high .n { color: var(--gold-hi); }
.more { margin-top: 16px; padding: 10px 20px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.join { margin-top: 40px; padding: 28px 22px; border-radius: 18px; background: linear-gradient(160deg, rgba(211, 172, 117, .14), rgba(125, 59, 59, .12)); border: 1px solid var(--line); }
.join p { margin: 0 0 18px; color: var(--muted); }
.join strong { color: var(--cream); font-weight: 400; font-family: var(--serif); font-size: 17px; }
.join small { display: block; margin-top: 14px; font-size: 12px; color: #74867f; }

/* ── 消息 ───────────────────────── */
.phone { text-align: left; border: 1px solid var(--line); border-radius: 26px; background: rgba(13, 26, 25, .86); backdrop-filter: blur(12px); overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .4); }
.phone-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(11, 22, 21, .6); }
.phone-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.phone-head strong { display: block; font-family: var(--serif); font-weight: 400; }
.phone-head small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.thread { height: min(62vh, 560px); overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.msg { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg .who { font-size: 12px; color: var(--muted); padding: 0 6px; }
.msg .who time { margin-left: 6px; opacity: .7; }
.msg .text { max-width: 82%; padding: 9px 14px; border-radius: 16px 16px 4px 16px; background: var(--cream); color: #1a2422; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.6; }
.msg .ops { display: flex; gap: 10px; padding: 0 6px; }
.msg .ops button { border: 0; background: none; padding: 2px 0; font-size: 12px; color: var(--muted); cursor: pointer; }
.msg .ops button:hover { color: var(--gold); }
.reply { display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; max-width: 88%; }
.reply img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.reply .text { max-width: none; border-radius: 16px 16px 16px 4px; background: #1c2f2c; color: var(--cream); border: 1px solid var(--line); }
.reply.role .text { background: linear-gradient(160deg, #23392f, #1a2b28); border-color: rgba(211, 172, 117, .5); }
.reply.role .who { color: var(--gold); }
.reply.fan { align-self: flex-end; flex-direction: row-reverse; }
.reply.fan .text { background: rgba(243, 236, 223, .14); color: var(--cream); border: 0; border-radius: 16px 16px 4px 16px; }
.reply .ph { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #2a3b38; font-size: 12px; flex: none; }
.reply-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reply.fan .reply-body { align-items: flex-end; }
.empty { white-space: pre-line; margin: auto; text-align: center; color: var(--muted); font-size: 14px; }
.composer { padding: 12px 14px 14px; border-top: 1px solid var(--line); background: rgba(11, 22, 21, .7); display: flex; flex-direction: column; gap: 8px; }
.composer #nickname { min-height: 38px; padding: 6px 12px; font-size: 14px; width: 50%; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { resize: none; min-height: 44px; max-height: 140px; line-height: 1.5; }
.send { flex: none; min-width: 64px; min-height: 44px; border: 0; border-radius: 12px; background: var(--gold); color: #1a1408; font-weight: 600; cursor: pointer; }
.send:disabled { opacity: .5; cursor: default; }
.composer .hint { margin: 0; min-height: 0; }
.reply-to { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-radius: 10px; background: rgba(211, 172, 117, .12); font-size: 13px; color: var(--gold); }
.reply-to button { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); min-width: 32px; min-height: 32px; }

/* ── 点梗 ───────────────────────── */
.idea-form { display: flex; gap: 8px; }
.ideas { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.idea { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(243, 236, 223, .06); }
.idea .rank { font: 18px var(--serif); color: var(--muted); width: 22px; flex: none; }
.idea:nth-child(-n+3) .rank { color: var(--gold); }
.idea .body { flex: 1; min-width: 0; }
.idea .body p { margin: 0; word-break: break-word; }
.idea .body small { color: var(--muted); font-size: 12px; }
.idea .body small button { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0 0 0 8px; cursor: pointer; }
.idea .note { margin-top: 6px; font-size: 13px; color: var(--gold); }
.heart { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 48px; min-height: 48px; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: none; cursor: pointer; font-size: 12px; color: var(--muted); line-height: 1.2; }
.heart span { font-size: 18px; }
.heart[aria-pressed="true"] { border-color: var(--wine); background: rgba(125, 59, 59, .3); color: #f0b9b0; }
.kicker.shown { margin-top: 48px; }
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.extra { position: relative; display: block; text-decoration: none; border-radius: 14px; overflow: hidden; background: var(--panel); }
.extra img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.extra .tag { position: absolute; top: 8px; left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 11px; background: rgba(11, 22, 21, .75); color: var(--gold); border: 1px solid var(--line); }
.extra strong { display: block; padding: 10px 12px 0; font-family: var(--serif); font-weight: 400; }
.extra small { display: block; padding: 0 12px 12px; color: var(--muted); font-size: 12px; }

footer { position: relative; z-index: 1; padding: 40px 20px 120px; text-align: center; color: #6f817a; font-size: 12px; }
footer .end { font-family: var(--serif); font-size: 15px; color: var(--muted); letter-spacing: .1em; }
footer a { color: #6f817a; }
.dock { display: none; }

/* ── 平板与手机：两个人并排在首屏 ───────────────────────── */
@media (max-width: 1099px) {
  .pair { position: absolute; height: 100svh; min-height: 640px; }
  .pair img { height: 78%; top: 0; bottom: auto; width: 62%; object-fit: cover; transition: none; }
  .pair-gu, .pair-lin, .pair-gu + .depth-portrait, .pair-lin + .depth-portrait { transform: none; }
  .pair-gu { left: -4%; object-position: 30% 0; -webkit-mask-image: linear-gradient(90deg, #000 58%, transparent 96%); mask-image: linear-gradient(90deg, #000 58%, transparent 96%); }
  .pair-lin { right: -4%; left: auto; object-position: 70% 0; -webkit-mask-image: linear-gradient(270deg, #000 58%, transparent 96%); mask-image: linear-gradient(270deg, #000 58%, transparent 96%); }
  .pair::after { background: linear-gradient(180deg, rgba(11, 22, 21, .1) 0, rgba(11, 22, 21, .1) 40%, var(--night) 82%); }
  /* 首屏底部给悬浮导航栏（约 56px + 12px 边距）留出空隙，内容不贴着它 */
  .opening { min-height: calc(100svh - 64px); justify-content: flex-end; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .chat-open { margin-bottom: 22px; }
  .lede { margin-bottom: 24px; }
  .welcome { margin-top: 18px; }
  .dock { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(16, 33, 32, .92); border: 1px solid var(--line); backdrop-filter: blur(12px); }
  .dock a { flex: 1; min-height: 44px; display: grid; place-items: center; border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--cream); }
  .dock a.gold { background: var(--gold); color: #1a1408; font-weight: 600; }
}
@media (max-width: 520px) {
  .topbar nav { display: none; }
  .roster-list { grid-template-columns: 1fr; }
  .badges { gap: 6px; }
  .phone { border-radius: 20px; margin: 0 -6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble { animation: none; opacity: 1; }
  .pair img { transition: none; }
}

/* ── 勋章与专属工牌页 ───────────────────────── */
.badge.paused { filter: grayscale(.85) brightness(.8); }
.my-badge { width: min(280px, 80%); }
.my-badge .btn { margin-top: 10px; width: 100%; }
.card-link { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--gold); }
.card-main { position: relative; z-index: 1; max-width: 420px; margin: 0 auto; padding: 48px 20px 64px; text-align: center; }
.card-letter { margin: 0 0 24px; font: 18px/1.7 var(--serif); }
.card-badge { width: min(300px, 78vw); margin: 0 auto; }
.shelf-title { margin-top: 28px; }
.card-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.card-main .join { margin-top: 28px; }
.card-main .home { margin-top: 28px; }
@media (max-width: 1099px) { .card-page .pair { opacity: .45; } }

/* ── 认领 ───────────────────────── */
.finder-title { display: block; margin: 0 0 12px; font-family: var(--serif); font-size: 18px; }
.release { margin-top: 12px; border: 0; background: none; color: #74867f; font-size: 12px; text-decoration: underline; cursor: pointer; }
.claim { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; }
.claim-title { margin: 0; font-family: var(--serif); font-size: 17px; text-align: center; }
.claim-why { margin: 6px 0 14px; font-size: 13px; color: var(--muted); text-align: center; }
.claim ol { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.claim li { counter-increment: step; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.claim li > span::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border: 1px solid var(--gold); border-radius: 50%; font-size: 12px; color: var(--gold); }
.claim li > span { font-size: 14px; }
.code-box { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(211, 172, 117, .12); border: 1px dashed var(--gold); }
.code-box strong { font: 600 20px var(--serif); letter-spacing: .08em; color: var(--gold-hi); }
.code-box button { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; font-size: 13px; }
.code-box a { margin-left: auto; font-size: 13px; color: var(--gold); }
.claim small { display: block; margin-top: 12px; font-size: 12px; color: #74867f; text-align: center; }
.as-me { margin: 0; font-size: 13px; color: var(--gold); }
.msg .who .staff, .reply .who .staff { margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; color: var(--gold); }
.key-tip { display: block; margin-top: 6px; font-size: 12px; color: #74867f; }

/* ── 3D 徽章 ───────────────────────── */
.medal-row, .medal-wall { list-style: none; margin: 16px 0 0; padding: 0; }
.medal-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.medal-row .coin { width: 44px; }
.medal-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; position: relative; padding-top: 26px; }
.medal-wall::before { content: "已点亮 " attr(data-count); position: absolute; top: 0; left: 0; right: 0; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.medal-wall + .btn { margin-top: 20px; }
.medal3d { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.medal3d strong { font: 400 13px/1.3 var(--serif); }
.medal3d small { font-size: 10.5px; line-height: 1.35; color: var(--muted); }
.coin { position: relative; width: min(76px, 100%); aspect-ratio: 1; perspective: 400px; touch-action: pan-y; cursor: grab; }
.coin img, .coin .custom-face { width: 100%; height: 100%; display: block; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); -webkit-user-drag: none; user-select: none; }
.coin.held img, .coin.held .custom-face { transition: transform .06s linear; }
/* 高光：一道斜向光带，随倾斜滑过；遮罩用徽章自身形状 */
.coin::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 50%; background: linear-gradient(115deg, transparent 35%, rgba(255, 246, 220, .55) var(--mx, 50%), transparent 65%); mix-blend-mode: overlay; opacity: 0; transition: opacity .3s; }
.coin.held::after { opacity: 1; }
.earned .coin { animation: float 4.5s ease-in-out infinite; animation-delay: calc(var(--i) * -.37s); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
.r-rare.earned .coin img { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)) drop-shadow(0 0 8px rgba(211, 172, 117, .35)); }
.r-limited.earned .coin img { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)) drop-shadow(0 0 14px rgba(236, 209, 162, .6)); }
.r-limited.earned strong { color: var(--gold-hi); }
.locked .coin { cursor: default; }
.locked .coin img { filter: grayscale(1) brightness(.32) contrast(1.1); opacity: .7; }
.custom-face { display: grid !important; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a2564f, #6a2e2e 70%); box-shadow: inset 0 0 0 4px #d3ac75, inset 0 0 0 6px #8c6a3a; font: 600 15px var(--serif); color: var(--gold-hi); }
.unlock { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5, 10, 9, .78); backdrop-filter: blur(6px); animation: fade .3s ease; }
.unlock-card { width: min(320px, 100%); padding: 28px 22px; border-radius: 22px; text-align: center; background: radial-gradient(circle at 50% 30%, rgba(211, 172, 117, .25), transparent 60%), var(--deep); border: 1px solid var(--line); }
.unlock-card .coin { width: 160px; margin: 8px auto 14px; }
.unlock-card strong { display: block; font: 400 22px var(--serif); }
.unlock-card small { display: block; margin: 6px 0 18px; color: var(--muted); font-size: 13px; }
.coin.flip img { animation: flipin 1.1s cubic-bezier(.2, .8, .2, 1); }
@keyframes flipin { from { transform: rotateY(-540deg) scale(.4); opacity: 0; } to { transform: rotateY(0) scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .earned .coin, .coin.flip img { animation: none; } }

/* ── 进站身份入口 ───────────────────────── */
.me-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1408; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; flex: none; }
.me-chip.is-me { padding: 0 12px 0 4px; background: rgba(16, 33, 32, .85); color: var(--cream); font-weight: 400; border: 1px solid var(--line); }
.me-chip.is-me span:last-child { max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
.me-chip img, .me-chip .ph { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #2a3b38; font-size: 12px; }
.welcome { display: flex; align-items: center; gap: 12px; width: min(100%, 420px); margin: 26px auto 0; padding: 12px 14px; border-radius: 16px; text-align: left; text-decoration: none; background: rgba(16, 33, 32, .82); border: 1px solid rgba(211, 172, 117, .45); box-shadow: 0 0 30px rgba(211, 172, 117, .12); backdrop-filter: blur(10px); animation: glow 3s ease-in-out infinite; }
.welcome-face { width: 48px; height: 48px; flex: none; display: grid; place-items: center; }
.welcome-face img, .welcome-face .ph { width: 48px; height: 48px; object-fit: contain; }
.welcome-face img[src*="api/avatar"], .welcome-face .ph { border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); display: grid; place-items: center; background: #2a3b38; }
.welcome-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.welcome-text strong { font: 400 16px/1.4 var(--serif); }
.welcome-text span { font-size: 12px; line-height: 1.5; color: var(--muted); }
.welcome-go { flex: none; font-size: 13px; color: var(--gold); white-space: nowrap; }
@keyframes glow { 50% { box-shadow: 0 0 40px rgba(211, 172, 117, .28); } }
@media (prefers-reduced-motion: reduce) { .welcome { animation: none; } }

.claim-video { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; text-decoration: none; background: rgba(11, 22, 21, .6); border: 1px solid var(--line); }
.cv-cover { position: relative; flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #1f3330; }
.cv-cover img { width: 100%; height: 100%; object-fit: cover; }
.cv-new { position: absolute; left: 4px; top: 4px; padding: 0 6px; border-radius: 4px; background: var(--wine); color: #fff; font-size: 10px; line-height: 16px; }
.cv-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cv-text em { font-style: normal; font-size: 11px; color: var(--gold); }
.cv-text strong { font-weight: 400; font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 姊妹站互通 */
.peers { display: grid; gap: 10px; margin-top: 18px; text-align: left; }
.peer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.peer strong { font: 400 15px var(--serif); }
.peer small { grid-column: 1; font-size: 12px; color: var(--muted); }
.peer .btn { grid-row: 1 / span 2; grid-column: 2; }
.peer.found { border-color: var(--gold); }
@media (max-width: 520px) { .peer { grid-template-columns: 1fr; } .peer .btn { grid-row: auto; grid-column: 1; margin-top: 8px; width: 100%; } }

/* 深度视差保持原人像位置；静态原图始终作为降级。 */
.pair .depth-portrait { position:absolute; pointer-events:none; }
.gyro-toggle { position:fixed; bottom:84px; right:16px; z-index:21; min-height:44px; padding:8px 14px; border:1px solid var(--line); border-radius:22px; background:var(--night); color:var(--gold); font:inherit; }
@media(max-width:520px) { .topbar { gap:8px; padding-inline:14px; } .mark { min-width:0; font-size:14px; } .topbar nav { flex-shrink:0; } .topbar nav a { padding-inline:7px; font-size:12px; } .cat-say { white-space:normal; max-width:90%; width:max-content; text-align:center; } }

/* 已点亮徽章：悬停 / 点按时转一圈闪光，稀有度换成获取条件 */
@property --mx { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
.medal-wall .earned { cursor: pointer; outline: none; border-radius: 12px; }
.medal-wall .earned:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
.m-flip { display: grid; }
.m-flip > span { grid-area: 1 / 1; transition: opacity .25s ease, transform .25s ease; }
.m-flip .m-rule { opacity: 0; transform: translateY(4px); color: var(--gold); }
.medal-wall .earned.reveal .m-tag { opacity: 0; transform: translateY(-4px); }
.medal-wall .earned.reveal .m-rule { opacity: 1; transform: none; }
.medal-wall .earned.reveal .coin img { animation: medal-spin .9s cubic-bezier(.2, .8, .2, 1); }
.medal-wall .earned.reveal .coin::after { animation: medal-shine .9s ease-out; }
@media (hover: hover) {
  .medal-wall .earned:hover .m-tag { opacity: 0; transform: translateY(-4px); }
  .medal-wall .earned:hover .m-rule { opacity: 1; transform: none; }
  .medal-wall .earned:hover .coin img { animation: medal-spin .9s cubic-bezier(.2, .8, .2, 1); }
  .medal-wall .earned:hover .coin::after { animation: medal-shine .9s ease-out; }
}
@keyframes medal-spin { 0% { transform: rotateY(0) scale(1); } 55% { transform: rotateY(320deg) scale(1.12); } 100% { transform: rotateY(360deg) scale(1); } }
@keyframes medal-shine { 0% { opacity: 0; --mx: 0%; } 30% { opacity: 1; } 100% { opacity: 0; --mx: 100%; } }
@media (prefers-reduced-motion: reduce) { .medal-wall .earned .coin img, .medal-wall .earned .coin::after { animation: none !important; } }

/* ── 消息墙：领卡锁、删除按钮、发送反馈与彩蛋（msgfx.js） ───────── */
.phone { position: relative; }
.msg-lock { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 12%, transparent); font-size: 13px; color: var(--muted); }
.msg-lock[hidden] { display: none !important; }
.msg-lock a { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--gold); color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; }
.composer textarea:disabled { opacity: .55; cursor: not-allowed; }
.msg .ops button, .reply .who .del { border: 0; background: none; padding: 2px 8px; border-radius: 999px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; transition: color .15s, background .15s; }
.msg .ops button:hover { color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.msg .ops .del:hover, .reply .who .del:hover { color: #d0566b; background: rgba(208, 86, 107, .1); }
.reply .who { display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; }
.reply .who .del { margin-left: 4px; padding: 0 8px; font-size: 11px; }
.reply { align-items: flex-start; }
.reply img, .reply .ph { margin-top: 20px; }
.fresh { animation: bubble-in .55s cubic-bezier(.2, 1.3, .4, 1) both; }
.reply.fan.fresh, .msg.fresh { transform-origin: 100% 100%; }
.reply.role.fresh { transform-origin: 0 100%; }
.glow .text { animation: bubble-glow 2.4s ease-out 2; }
.text.liked { animation: bubble-like .45s cubic-bezier(.2, 1.4, .4, 1); }
.send.done { animation: send-done .6s ease; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.fx-p { position: absolute; transform: translate(-50%, -50%); animation: fx-burst 1s cubic-bezier(.15, .8, .3, 1) both; will-change: transform, opacity; }
.fx-p.fx-float { animation-name: fx-float; animation-timing-function: cubic-bezier(.3, .6, .4, 1); }
.fx-p.fx-heart { animation-name: fx-heart; }
.fx-toast { position: absolute; left: 50%; top: 72px; z-index: 6; margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--gold); color: #fff; font-size: 12px; letter-spacing: .1em; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, -8px) scale(.9); transition: opacity .25s, transform .35s cubic-bezier(.2, 1.4, .4, 1); box-shadow: 0 8px 20px rgba(0, 0, 0, .15); }
.fx-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
@keyframes bubble-in { 0% { opacity: 0; transform: translateY(14px) scale(.85); } 100% { opacity: 1; transform: none; } }
@keyframes bubble-glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 45%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes bubble-like { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes send-done { 0% { transform: scale(1); } 30% { transform: scale(.88); } 65% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes fx-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1); } }
@keyframes fx-float { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 12% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), var(--dy)) rotate(var(--rot)) scale(1.1); } }
@keyframes fx-heart { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, calc(-50% + var(--dy))) scale(1); } }
@media (prefers-reduced-motion: reduce) { .fresh, .glow .text, .text.liked, .send.done { animation: none; } .fx-layer { display: none; } }
.reply .who { font-size: 12px; color: var(--muted); padding: 0 6px; }
.reply .who time { margin-left: 6px; opacity: .7; }
.reply .text { margin: 0; padding: 9px 14px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.6; }
.reply.role .who { color: var(--gold); }

/* 徽章详情 + 我的小剧场 */
.unlock.detail .unlock-card { position: relative; overflow: hidden; animation: m-pop .35s cubic-bezier(.2, 1.2, .3, 1) both; }
.unlock-card .m-how { margin: 4px 0 6px; font-size: 14px; line-height: 1.6; }
.unlock-card .m-meta { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.unlock-card.locked .coin { filter: grayscale(.85) brightness(.9); opacity: .75; }
.unlock-card .spark { position: absolute; left: 50%; top: 96px; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--gold, #c9a24b); opacity: 0; animation: m-spark .9s ease-out both; }
@keyframes m-pop { from { transform: scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes m-spark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)); } }
@media (prefers-reduced-motion: reduce) { .unlock.detail .unlock-card { animation: none; } .unlock-card .spark { display: none; } }
.medal-wall li[role=button] { cursor: pointer; }
#games { display: grid; gap: 14px; margin: 8px 0 18px; }
.cg-game { padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--cream); }
.cg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.cg-head small { color: var(--muted); }
.cg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cg-grid figure { margin: 0; position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--cream) 8%, transparent); border: 1px solid color-mix(in srgb, var(--cream) 10%, transparent); }
.cg-grid figure button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.cg-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-grid .cg-lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: var(--muted); }
.cg-grid figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: 10px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.cg-grid .locked figcaption { color: var(--muted); background: none; }
.cg-ends { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.cg-ends span { padding: 3px 10px; border-radius: 999px; font-size: 12px; background: color-mix(in srgb, var(--cream) 8%, transparent); color: var(--muted); }
.cg-ends span.on { background: var(--gold, #c9a24b); color: var(--night, #fff); }
.cg-zoom { flex-direction: column; gap: 10px; }
.cg-zoom img { max-width: min(96vw, 900px); max-height: 80vh; border-radius: 12px; }
.cg-zoom p { color: #fff; margin: 0; }

.recover { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.recover summary { cursor: pointer; padding: 6px 0; }
.recover .finder-row { margin-top: 6px; }
#copy-card-link { margin: 8px 0 4px; }
#open-card-link { display: flex; width: min(280px, 100%); margin: 14px auto 4px; }

/* ── 小剧场（深色版）：列表由 theater.js 按 games.js 渲染 ── */
.new-play { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 7px 14px; border-radius: 999px; background: rgba(18, 34, 32, .72); border: 1px solid var(--line); color: var(--cream); font-size: 13px; text-decoration: none; }
.new-play[hidden] { display: none !important; }
.new-play b { padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #1a1408; font-size: 11px; letter-spacing: .08em; }
.new-play i { font-style: normal; color: var(--gold); }
.play-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.play-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--cream); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.play-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.pc-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #16302d, #0b1615); }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .55)); }
.pc-no { position: absolute; left: 12px; bottom: 10px; z-index: 1; color: #fff; font-size: 12px; letter-spacing: .1em; }
.pc-lock { position: absolute; inset: 0; display: grid; place-items: center; font: 400 40px var(--serif); color: var(--gold); }
.pc-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.pc-body strong { font: 400 20px/1.3 var(--serif); }
.pc-body small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.pc-progress { font-style: normal; font-size: 12px; color: var(--muted); }
.pc-go { padding: 7px 14px; border-radius: 999px; background: var(--gold); color: #1a1408; font-size: 13px; font-weight: 600; }
.play-card.soon { border-style: dashed; background: rgba(18, 34, 32, .45); }
.play-card.soon .pc-go { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.play-card.done .pc-progress::before { content: "✓ "; color: var(--gold); }
@media (max-width: 640px) {
  .play-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: -16px; padding: 0 16px 8px; }
  .play-list::-webkit-scrollbar { display: none; }
  .play-card { flex: 0 0 82%; scroll-snap-align: center; }
}
@media (prefers-reduced-motion: reduce) { .play-card { transition: none; } }

.cand-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; margin-top: 8px; }
.cand { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; border: 1px solid rgba(128, 128, 128, .3); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cand img, .cand .ph { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; background: rgba(128, 128, 128, .2); }
.cand span { font-size: 13px; }

/* 身份：荣誉（银）/ 一直在（金） */
.badge.honor .title { color: #5f6b72; }
.badge.honor .no { color: #7b858b; letter-spacing: .3em; }
.badge.loyal .title { color: #8a5d0b; font-weight: 600; }
/* 金色（一直在）/ 银色（荣誉）工牌底图 */
.badge.loyal.has-art { --art: url(assets/badge-gold.webp); background-image: url(assets/badge-gold.webp); filter: drop-shadow(0 6px 18px rgba(211, 172, 117, .38)); }
.badge.honor.has-art { background-image: url(assets/badge-silver.webp); }
.badge .sheen { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 230, 160, .5) 50%, transparent 70%) 0 0 / 260% 100%; mix-blend-mode: soft-light; animation: badge-sheen 5s ease-in-out infinite; }
@keyframes badge-sheen { 0%, 55% { background-position: 130% 0; } 100% { background-position: -130% 0; } }
@media (prefers-reduced-motion: reduce) { .badge .sheen { animation: none; opacity: .5; } }
.honor-wall { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.honor-wall summary { cursor: pointer; font-weight: 600; letter-spacing: .08em; color: var(--gold-hi, var(--muted)); }
.honor-wall .sub { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.member.honor { filter: grayscale(.4); opacity: .92; }
.promote { margin: 6px 0 0; font-size: 13px; color: var(--muted); text-align: center; letter-spacing: .04em; }

/* 徽章墙：稀有度靠质感区分（银边=普通，金边流光=稀有，钻光=限定），条件与点亮日期常驻显示；未点亮用进度条 */
/* 质感图例已移到详情弹窗（稀有度写在弹窗顶部） */
.medal3d .m-got { display: grid; gap: 2px; justify-items: center; }
.medal3d .m-got .m-rule { color: var(--cream, var(--ink)); opacity: .86; }
.medal3d .m-got .m-when { color: var(--muted); font-size: 10px; white-space: nowrap; }
.r-rare.earned .m-got .m-when, .r-limited.earned .m-got .m-when { color: var(--gold); }
.medal3d .m-progress { display: grid; gap: 3px; width: 100%; justify-items: center; }
.medal3d .m-bar { display: block; width: 78%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.medal3d .m-bar::after { content: ""; display: block; width: var(--p, 0%); height: 100%; background: linear-gradient(90deg, var(--gold, #c9a24b), var(--gold-hi, #ecd1a2)); }
/* 普通：银边冷光；稀有：金边 + 缓慢流光；限定：更亮的金钻光 + 闪烁，略大一点 */
.r-common.earned .coin img { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)) drop-shadow(0 0 1px rgba(226, 232, 242, .75)); }
.r-rare.earned .coin img { filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .45)) drop-shadow(0 0 1.5px rgba(240, 205, 135, .95)) drop-shadow(0 0 9px rgba(211, 172, 117, .5)); }
.r-limited.earned .coin { width: min(82px, 100%); }
.r-limited.earned .coin img { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)) drop-shadow(0 0 2px rgba(255, 236, 190, 1)) drop-shadow(0 0 16px rgba(240, 205, 135, .7)); }
.r-rare.earned .coin::after, .r-limited.earned .coin::after { opacity: 1; background: linear-gradient(115deg, transparent 35%, rgba(255, 246, 220, .6) 50%, transparent 65%); background-size: 260% 100%; animation: rare-sheen 4.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.r-limited.earned .coin::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 28% 22%, rgba(255, 250, 230, .95) 0 2px, transparent 3px), radial-gradient(circle at 76% 70%, rgba(255, 250, 230, .8) 0 1.6px, transparent 2.6px), radial-gradient(circle at 82% 24%, rgba(255, 250, 230, .7) 0 1.4px, transparent 2.4px); animation: gem-twinkle 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
@keyframes rare-sheen { 0%, 55% { background-position: 130% 0; } 100% { background-position: -130% 0; } }
@keyframes gem-twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .r-rare.earned .coin::after, .r-limited.earned .coin::after, .r-limited.earned .coin::before { animation: none; } }
.medal3d .m-progress .m-count { color: var(--gold, inherit); font-size: 11px; }
.medal3d .m-progress .m-rule { color: var(--muted); }


/* 金色工牌的流光只落在工牌本体上：按底图轮廓裁切，避免流光层的矩形边界在深色背景上露出来 */
.badge .sheen { -webkit-mask: var(--art) center / 100% 100% no-repeat; mask: var(--art) center / 100% 100% no-repeat; }
.badge:not(.loyal) .sheen { display: none; }

/* 分级勋章：同一枚图标，按级别换铜 / 银 / 金边框，右下角罗马数字 */
.coin[data-tier]::before { content: ""; position: absolute; inset: -3px; z-index: 1; border-radius: 50%; padding: 3px; pointer-events: none; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.coin[data-tier="1"]::before { background: conic-gradient(from 210deg, #8a5a33, #e0a56a, #8a5a33, #c78a54, #8a5a33); }
.coin[data-tier="2"]::before { background: conic-gradient(from 210deg, #8c97a0, #f1f5f8, #8c97a0, #cfd8df, #8c97a0); }
.coin[data-tier="3"]::before { background: conic-gradient(from 210deg, #b98a2a, #ffe9a8, #b98a2a, #f3cb6a, #b98a2a); box-shadow: 0 0 14px rgba(255, 220, 130, .55); }
.tier-pip { position: absolute; right: -4px; bottom: -4px; z-index: 2; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; display: grid; place-items: center; font: 600 11px/1 var(--serif, serif); color: #1a1208; background: linear-gradient(135deg, #f7e2b0, #c9993f); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.coin[data-tier="1"] .tier-pip { background: linear-gradient(135deg, #f2c28f, #9a6034); }
.coin[data-tier="2"] .tier-pip { background: linear-gradient(135deg, #ffffff, #aab5bd); }
.locked .coin[data-tier]::before, .locked .tier-pip { filter: grayscale(1) brightness(.5); }

.claim-qq { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.claim-or { margin: 0 0 8px; font-size: 13px; opacity: .8; }
