:root {
  --bg: #0a0a0f;
  --lime: #c6ff00;
  --pink: #ff2e88;
  --cyan: #00e5ff;
  --ink: #f4f4f0;
  --mute: #8a8a96;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --display: "Impact", "Arial Black", "Haettenschweiler", var(--font);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--font); min-height: 100%; overflow-x: hidden; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.top, main { position: relative; z-index: 2; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; }
.logo { font-family: var(--display); font-size: 22px; letter-spacing: 1px; }
.logo b { color: var(--bg); background: var(--lime); padding: 0 6px; margin-left: 4px; transform: skew(-10deg); display: inline-block; }
.tag { font-size: 12px; color: var(--mute); border: 1px solid #333; padding: 4px 10px; border-radius: 99px; }

main { max-width: 480px; margin: 0 auto; padding: 0 18px 30px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 9vh 0 26px; }
h1 { display: flex; flex-direction: column; line-height: .88; transform: rotate(-4deg); }
h1 .l1 {
  font-family: var(--display); font-size: clamp(64px, 22vw, 108px); color: transparent;
  -webkit-text-stroke: 2px var(--ink); letter-spacing: 2px;
}
h1 .l2 { font-family: var(--display); font-size: clamp(46px, 15vw, 78px); text-shadow: 4px 4px 0 var(--pink); }
h1 .l2 em { font-style: normal; color: var(--lime); text-shadow: 4px 4px 0 var(--pink), 0 0 24px rgba(198,255,0,.5); }
h1 .cn { margin-top: 14px; font-size: 18px; font-weight: 900; letter-spacing: 6px; color: var(--ink); }
.sticker {
  position: absolute; font-family: var(--display); font-size: 13px; padding: 4px 10px;
  border: 2px solid var(--bg); box-shadow: 3px 3px 0 var(--bg); z-index: 3;
}
.s1 { right: 4px; top: 6vh; background: var(--cyan); color: var(--bg); transform: rotate(12deg); animation: bob 2.5s ease-in-out infinite; }
.s2 { right: 34px; bottom: 6px; background: var(--pink); color: var(--ink); transform: rotate(-8deg); animation: bob 2.5s ease-in-out .6s infinite; }
@keyframes bob { 50% { translate: 0 -6px; } }

/* ---------- Card ---------- */
.card {
  position: relative; background: rgba(14,14,20,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 2px solid var(--ink); border-radius: 18px; padding: 20px 18px 22px;
  box-shadow: 8px 8px 0 var(--lime); animation: rise .6s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(30px) rotate(2deg); } }
.card-head { font-weight: 900; font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card-head i { font-style: normal; color: var(--mute); font-weight: 400; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 10px var(--pink); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

form label { display: block; margin-bottom: 12px; }
form label span { display: block; font-size: 12px; color: var(--mute); margin: 0 0 6px 2px; letter-spacing: 1px; }
input {
  width: 100%; height: 50px; border-radius: 12px; border: 2px solid #2b2b36; background: #111118;
  color: var(--ink); font-size: 17px; padding: 0 14px; outline: none; transition: .2s; font-family: inherit;
}
input::placeholder { color: #50505c; }
input:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(198,255,0,.15); background: #14141c; }

button {
  font-family: inherit; cursor: pointer; border: 0;
}
.search { display: flex; gap: 10px; }
.search input { flex: 1; height: 58px; font-size: 18px; letter-spacing: .5px; }
#goBtn {
  flex: 0 0 76px; height: 58px; border-radius: 14px; background: var(--lime); color: var(--bg);
  display: grid; place-items: center; border: 2px solid var(--bg); box-shadow: 4px 4px 0 var(--pink); transition: transform .1s, box-shadow .1s;
}
#goBtn b { font-family: var(--display); font-size: 24px; letter-spacing: 1px; }
#goBtn:active { transform: translate(4px,4px); box-shadow: 0 0 0 var(--pink); }
#goBtn.loading { opacity: .7; pointer-events: none; }
#goBtn.loading b { font-size: 0; }
#goBtn.loading b::after { content: ""; display: inline-block; width: 20px; height: 20px; border: 3px solid var(--bg); border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chips { display: flex; gap: 8px; margin-top: 14px; }
.chips span { font-size: 12px; padding: 4px 12px; border-radius: 99px; border: 1px solid #33333f; color: var(--mute); transition: .2s; }
.chips span.on { background: var(--cyan); border-color: var(--cyan); color: var(--bg); font-weight: 900; transform: rotate(-3deg) scale(1.06); }
.err { min-height: 20px; margin-top: 12px; color: var(--pink); font-size: 14px; font-weight: 700; text-align: center; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* ---------- Result ---------- */
.hidden { display: none; }
.result { box-shadow: 8px 8px 0 var(--pink); overflow: hidden; }
.stamp {
  position: absolute; right: -8px; top: 18px; font-family: var(--display); font-size: 22px; letter-spacing: 2px;
  color: var(--bg); background: var(--lime); padding: 6px 18px; transform: rotate(10deg);
  border: 2px solid var(--bg); box-shadow: 3px 3px 0 var(--bg); animation: slam .5s .25s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes slam { from { transform: rotate(10deg) scale(3); opacity: 0; } }
.r-name { font-size: 28px; font-weight: 900; margin-top: 4px; }
.r-name small { display: block; font-size: 12px; font-weight: 400; color: var(--mute); letter-spacing: 2px; margin-top: 2px; }
.r-grade {
  font-size: clamp(72px, 26vw, 120px); font-weight: 900; line-height: 1; margin: 14px 0 18px; letter-spacing: 6px;
  background: linear-gradient(100deg, var(--lime), var(--cyan) 50%, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(198,255,0,.35)); animation: pop .7s .1s cubic-bezier(.2,1.5,.4,1) both;
}
@keyframes pop { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid div { background: #111118; border: 1px solid #262630; border-radius: 12px; padding: 10px 12px; }
.grid .wide { grid-column: span 2; }
.grid span { display: block; font-size: 11px; color: var(--mute); letter-spacing: 1px; }
.grid b { display: block; font-size: 15px; margin-top: 4px; word-break: break-all; }
.r-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 900; }
.r-head span { background: rgba(10,10,15,.75); padding: 4px 10px; border-radius: 8px; }
#rList { display: grid; gap: 22px; }
.ghost.sm { width: auto; height: 38px; margin: 0; padding: 0 14px; font-size: 13px; background: rgba(10,10,15,.75); }
.ghost { margin-top: 16px; width: 100%; height: 48px; border-radius: 12px; background: transparent; color: var(--ink); border: 2px dashed #444; font-size: 15px; font-weight: 700; }

/* ---------- Ticker ---------- */
.ticker { margin: 34px -18px 0; background: var(--pink); color: var(--bg); transform: rotate(-2deg); overflow: hidden; border-block: 2px solid var(--bg); }
.track { white-space: nowrap; font-family: var(--display); font-size: 20px; padding: 8px 0; display: inline-block; animation: marquee 18s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
footer { text-align: center; color: #c9c9d2; font-size: 12px; margin: 26px auto 0; width: fit-content; padding: 4px 12px; border-radius: 99px; background: rgba(10,10,15,.75); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
