@charset "UTF-8";
:root{
  color-scheme:light;
  --bg:#F4F2ED;--paper:#FFFFFF;--ink:#16161A;--ink-2:#45454D;--muted:#86868E;--line:rgba(22,22,26,.1);--line-2:rgba(22,22,26,.06);
  --accent:#16161A;--soft:#ECE9E2;--ok:#2E8B57;--err:#C0392B;
  --r:18px;--shadow:0 1px 2px rgba(0,0,0,.04),0 12px 32px -12px rgba(0,0,0,.12);
  font-family:"PingFang SC","HarmonyOS Sans SC","MiSans","Microsoft YaHei",system-ui,sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
button,input{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:disabled{opacity:.5;cursor:wait}
a{color:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}
h1,h2,h3,p,dl,dd{margin:0}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--ink);outline-offset:3px;border-radius:6px}

.topbar{width:100%;max-width:720px;margin:0 auto;padding:calc(14px + env(safe-area-inset-top)) 20px 6px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.home{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--ink-2);letter-spacing:.04em}
.badge{display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:var(--ink);color:#fff;font-size:13px;font-weight:800}
.link{border:0;background:none;padding:10px 2px;font-size:13px;color:var(--ink-2);min-height:44px}
.link:hover{color:var(--ink)}
.user{max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

main{width:100%;max-width:720px;margin:0 auto;padding:0 20px;flex:1}
.screen{display:none;animation:in .35s cubic-bezier(.2,.7,.2,1)}
.screen.active{display:block}
@keyframes in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.screen{animation:none}}

/* 首页 */
#home{padding:28px 0 40px;text-align:left}
.eyebrow{font-size:11px;letter-spacing:.32em;color:var(--muted);font-weight:600}
h1{font-size:clamp(38px,10vw,64px);line-height:1.08;letter-spacing:-.02em;font-weight:900;margin-top:14px}
.lead{margin-top:14px;font-size:15px;color:var(--ink-2)}
.parade{display:flex;gap:10px;margin:26px -20px 6px;padding:0 20px;overflow:hidden;mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)}
.parade .track{display:flex;gap:10px;animation:marquee 60s linear infinite;flex:none}
.parade svg{width:108px;height:108px;flex:none;border-radius:22px;background:var(--paper)}
@keyframes marquee{to{transform:translateX(-50%)}}
@media (prefers-reduced-motion:reduce){.parade .track{animation:none}}
.facts{display:grid;grid-template-columns:repeat(3,1fr);margin:22px 0 26px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.facts div{padding:14px 4px}
.facts div+div{border-left:1px solid var(--line);padding-left:14px}
.facts dt{font-size:24px;font-weight:900;letter-spacing:-.02em}
.facts dd{font-size:12px;color:var(--muted);margin-top:2px}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:12px 22px;border-radius:14px;border:1px solid var(--ink);font-size:15px;font-weight:700;transition:transform .12s,background .15s,opacity .15s}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--ink);color:#fff}
.btn.ghost{background:transparent;color:var(--ink);border-color:var(--line)}
.btn.ghost:hover{border-color:var(--ink)}
.btn.big{width:100%;min-height:56px;font-size:17px}
.btn.big+.btn.big{margin-top:10px}
.btn.full{width:100%}

.gift{display:flex;gap:14px;align-items:center;margin-top:18px;padding:16px;border-radius:var(--r);background:var(--paper);box-shadow:var(--shadow)}
.gift-mark{flex:none;display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#B23A2E;color:#fff;font-weight:900}
.gift p{display:flex;flex-direction:column;gap:3px;font-size:14px}
.gift p span{font-size:12px;color:var(--muted)}
.last{margin-top:12px;padding:14px 16px;border-radius:var(--r);border:1px solid var(--line);display:flex;align-items:center;gap:12px;font-size:14px}
.last svg{width:48px;height:48px;flex:none}
.last .link{margin-left:auto}
.home-links{margin-top:10px}
.players{font-size:12px;color:var(--muted);margin-top:4px}

/* 答题 */
#quiz{padding:18px 0 30px}
.progress{height:4px;border-radius:4px;background:var(--soft);overflow:hidden}
.progress span{display:block;height:100%;width:0;background:var(--ink);transition:width .35s}
.quiz-head{display:flex;justify-content:space-between;margin:12px 0 18px;font-size:12px;color:var(--muted);letter-spacing:.06em}
.qcard{background:var(--paper);border-radius:24px;padding:28px 22px 22px;box-shadow:var(--shadow);transition:opacity .18s,transform .18s}
.qcard.leave{opacity:0;transform:translateX(-12px)}
.qno{font-size:12px;font-weight:800;letter-spacing:.2em;color:var(--muted)}
.qcard h2{font-size:clamp(21px,5.6vw,26px);line-height:1.4;font-weight:800;margin:10px 0 22px;letter-spacing:-.01em}
.opts{display:grid;gap:10px}
.opt{display:flex;align-items:center;gap:14px;width:100%;text-align:left;min-height:56px;padding:12px 16px;border-radius:14px;border:1px solid var(--line);background:#FAFAF8;font-size:16px;line-height:1.45;transition:border-color .15s,background .15s}
.opt b{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--soft);font-size:13px}
@media (hover:hover){.opt:hover{border-color:var(--ink);background:#fff}}
.opt.picked{border-color:var(--ink);background:var(--ink);color:#fff}
.opt.picked b{background:rgba(255,255,255,.18)}
.quiz-foot{display:flex;justify-content:space-between;margin-top:10px}

/* 分析中 */
#loading{padding:120px 0;text-align:center}
.spinner{display:flex;justify-content:center;gap:10px;margin-bottom:22px}
.spinner span{width:14px;height:14px;background:var(--ink);transform:rotate(45deg);animation:hop 1s infinite ease-in-out}
.spinner span:nth-child(2){animation-delay:.15s}.spinner span:nth-child(3){animation-delay:.3s}
@keyframes hop{50%{transform:translateY(-14px) rotate(225deg)}}
#loadingText{font-size:15px;color:var(--ink-2);min-height:24px}

/* 结果 */
#result{padding:16px 0 30px}
.rcard{background:var(--paper);border-radius:28px;box-shadow:var(--shadow);overflow:hidden}
.r-top{padding:26px 22px 0;text-align:center}
.r-kicker{font-size:13px;color:var(--muted)}
.r-name{font-size:clamp(40px,12vw,58px);font-weight:900;letter-spacing:-.02em;line-height:1.1;margin-top:6px}
.r-code{margin-top:8px;font-size:17px;font-weight:800;color:var(--accent);letter-spacing:.02em}
.r-tag{margin-top:6px;font-size:14px;color:var(--ink-2)}
.r-art{width:min(86%,380px);margin:8px auto 0;display:block}
.r-art svg{width:100%;height:auto;display:block}
.r-meta{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;padding:0 22px}
.pill{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:99px;background:var(--soft);font-size:12px;font-weight:700}
.pill.accent{background:var(--accent);color:#fff}
.r-body{padding:22px}
.r-traits{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-bottom:18px}
.r-traits span{padding:7px 12px;border:1px solid var(--line);border-radius:10px;font-size:13px;font-weight:600}
.r-desc{font-size:15px;line-height:1.85;color:var(--ink-2)}
.r-sec{margin-top:24px}
.r-sec h3{font-size:12px;letter-spacing:.2em;color:var(--muted);font-weight:800;margin-bottom:12px}
.dim{display:grid;grid-template-columns:4.5em 1fr;align-items:center;gap:12px;margin-bottom:12px;font-size:13px}
.dim .bar{position:relative;height:8px;border-radius:8px;background:var(--soft)}
.dim .bar i{position:absolute;left:0;top:0;bottom:0;border-radius:8px;background:var(--accent)}
.dim .ends{grid-column:2;display:flex;justify-content:space-between;font-size:11px;color:var(--muted);margin-top:-8px}
.r-lines{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.r-lines li{padding:12px 14px;border-radius:12px;background:#FAFAF8;font-size:14px}
.r-quote{margin-top:24px;padding:18px;border-left:3px solid var(--accent);background:#FAFAF8;border-radius:0 12px 12px 0;font-size:16px;font-weight:700}
.rel{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
.rel button{border:1px solid var(--line);background:#fff;border-radius:14px;padding:10px 6px 12px;text-align:center}
.rel svg{width:72px;height:72px;display:block;margin:0 auto}
.rel small{display:block;font-size:11px;color:var(--muted)}
.rel b{display:block;font-size:13px;margin-top:2px}

.reward{margin-top:14px;padding:20px;border-radius:24px;background:var(--ink);color:#fff}
.reward h3{font-size:17px;font-weight:800}
.reward p{font-size:13px;line-height:1.7;color:rgba(255,255,255,.75);margin-top:6px}
.reward .row{display:flex;gap:8px;margin-top:14px}
.reward input{flex:1;min-width:0;min-height:48px;border-radius:12px;border:1px solid rgba(255,255,255,.2);background:rgba(255,255,255,.08);padding:0 14px;color:#fff;font-size:16px}
.reward input::placeholder{color:rgba(255,255,255,.45)}
.reward .btn{border-color:#fff;background:#fff;color:var(--ink);flex:none}
.reward .btn.ghost{background:transparent;color:#fff;border-color:rgba(255,255,255,.3)}
.reward .msg{color:#FFD9D2}
.reward .msg.ok{color:#B9F0CB}
.reward .card-art{display:flex;align-items:center;gap:14px}
.reward .card-art span{flex:none;width:52px;height:68px;border-radius:10px;background:linear-gradient(150deg,#C0392B,#7A1F18);display:grid;place-items:center;font-weight:900;font-size:13px;line-height:1.2;text-align:center;box-shadow:inset 0 0 0 2px rgba(255,255,255,.2)}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.actions .btn.primary{grid-column:1/-1;min-height:56px;font-size:17px}

/* 图鉴 */
#gallery{padding:12px 0 30px}
.gallery-head{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.gallery-head h2{font-size:20px;font-weight:900}
.ggrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.gitem{border:0;background:var(--paper);border-radius:18px;padding:8px 8px 12px;text-align:center;box-shadow:var(--shadow)}
.gitem svg{width:100%;height:auto;display:block}
.gitem b{display:block;font-size:14px;margin-top:4px}
.gitem small{display:block;font-size:11px;color:var(--muted);letter-spacing:.06em}
.gitem.mine{outline:2px solid var(--ink)}

footer{width:100%;max-width:720px;margin:0 auto;padding:22px 20px calc(22px + env(safe-area-inset-bottom));display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted)}

/* 弹窗 */
dialog{border:0;padding:0;background:transparent;max-width:min(440px,calc(100vw - 24px));width:100%;max-height:calc(100dvh - 24px)}
dialog::backdrop{background:rgba(16,16,20,.45);backdrop-filter:blur(4px)}
.sheet{position:relative;background:var(--paper);border-radius:24px;padding:28px 22px 22px;max-height:calc(100dvh - 24px);overflow:auto}
.sheet.wide{padding:0}
dialog#typeDialog{max-width:min(560px,calc(100vw - 24px))}
.x{position:absolute;top:12px;right:12px;width:40px;height:40px;border:0;border-radius:12px;background:var(--soft);font-size:15px;z-index:2}
.sheet h2{font-size:22px;font-weight:900;padding-right:40px}
.sub{font-size:13px;color:var(--muted);margin-top:6px;line-height:1.6}
.tabs{display:flex;gap:4px;margin:18px 0 12px;padding:4px;background:var(--soft);border-radius:12px}
.tabs button{flex:1;border:0;background:none;border-radius:9px;padding:9px 4px;font-size:14px;font-weight:600;color:var(--ink-2);min-height:40px}
.tabs button[aria-selected=true]{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.vguide{display:flex;gap:12px;align-items:center;width:100%;text-align:left;border:1px solid var(--line);background:#FAFAF8;border-radius:12px;padding:10px;margin-bottom:12px}
.vguide .thumb{flex:none;width:52px;height:36px;border-radius:8px;background:#222 url("https://qixi888.com/media/reg-guide.jpg") center/cover}
.vguide b{display:block;font-size:13px}
.vguide span span{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.pane{display:none}.pane.active{display:block}
.field{margin-bottom:12px}
.field label{display:block;font-size:12px;color:var(--ink-2);margin-bottom:6px;font-weight:600}
.field input{width:100%;min-height:48px;border-radius:12px;border:1px solid var(--line);background:#FAFAF8;padding:0 14px;font-size:16px}
.field input:focus{outline:none;border-color:var(--ink);background:#fff}
.msg{font-size:13px;color:var(--err);margin-top:10px;min-height:1em;line-height:1.6}
.msg.ok{color:var(--ok)}
.note{font-size:12px;color:var(--ink-2);line-height:1.75;margin:12px 0}
.codebox{padding:18px;border-radius:14px;background:var(--soft);text-align:center;margin-bottom:10px}
.code{font-size:28px;font-weight:900;letter-spacing:.12em;word-break:break-all}
.accname{display:flex;gap:12px;align-items:center;margin:18px 0}
.ava{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:var(--ink);color:#fff;font-weight:800}
.accname span{display:block;font-size:12px;color:var(--muted)}
.image-sheet img{display:block;width:100%;border-radius:14px;margin:14px 0;background:var(--soft);min-height:120px}
.vsheet{background:#000;border-radius:18px;overflow:hidden}
.vhead{display:flex;justify-content:space-between;align-items:center;padding:8px 8px 8px 14px;color:#fff;font-size:13px}
.vhead button{border:0;background:rgba(255,255,255,.12);color:#fff;width:36px;height:36px;border-radius:10px}
video{display:block;width:100%;max-height:70dvh}
.toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translate(-50%,20px);max-width:calc(100vw - 32px);padding:12px 18px;border-radius:14px;background:var(--ink);color:#fff;font-size:14px;opacity:0;pointer-events:none;transition:.25s;z-index:99;text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media (min-width:760px){
  .ggrid{grid-template-columns:repeat(5,1fr)}
  .actions{grid-template-columns:2fr 1fr 1fr}
  .actions .btn.primary{grid-column:auto;min-height:48px;font-size:15px}
  .r-body{padding:28px 34px}
}
@media (min-width:1100px){
  body.wide main,body.wide .topbar,body.wide footer{max-width:1100px}
  body.wide .ggrid{grid-template-columns:repeat(8,1fr)}
}
/* 手机横屏：压缩首屏与答题卡高度 */
@media (max-height:500px) and (orientation:landscape){
  #home{padding-top:12px}
  h1{font-size:34px}
  .parade svg{width:80px;height:80px}
  .qcard{padding:18px 18px 14px}
  .qcard h2{margin:6px 0 12px;font-size:19px}
  .opts{grid-template-columns:1fr 1fr;gap:8px}
  .opt{min-height:46px;padding:8px 12px;font-size:14px}
  #loading{padding:50px 0}
}

