@import url('./tokens.css');
:root {
  --qinglong-font:'Microsoft YaHei','微软雅黑',sans-serif;
  --treasure-ink:#e7f3f6;
  --treasure-muted:#bdd2dd;
  --treasure-bg:#173c50;
  --treasure-deep:#0d2939;
  --treasure-line:#527487;
  --gold:#dfbe76;
  --gold-light:#f6e3af;
  --gold-ink:#59411a;
  --tier-a:#986921;
  --tier-b:#935982;
  --tier-c:#3b7e9e;
  --tier-d:#597468
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  color:var(--text);
  background:var(--bg-gradient);
  font:14px/1.6 var(--qinglong-font)
}
button,input,select {
  font:inherit
}
button,a,input,select {
  -webkit-tap-highlight-color:transparent
}
button,select,input {
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
  color:var(--text);
  min-height:40px
}
button {
  padding:7px 14px;
  cursor:pointer;
  transition:background .16s,transform .16s
}
button:hover:enabled {
  background:var(--surface-cool)
}
button:active:enabled {
  transform:translateY(1px)
}
button:disabled {
  opacity:.45;
  cursor:not-allowed
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid var(--focus-ring);
  outline-offset:3px
}
select {
  padding:5px 8px
}
a {
  color:var(--accent);
  text-decoration:none
}
p,h1,h2,h3 {
  margin:0
}
h1,h2 {
  font-weight:600
}
button.quiet {
  background:transparent
}
button.text-button {
  background:transparent;
  border:0;
  color:var(--accent);
  padding:0 3px;
  min-height:32px
}
.shell {
  max-width:1320px;
  margin:auto;
  padding:26px 32px 12px
}
.header {
  display:flex;
  align-items:center;
  gap:20px
}
.brand {
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  color:var(--muted)
}
.brand span {
  font-weight:400;
  color:var(--line-strong);
  margin-left:8px
}
.heading h1 {
  font:600 30px/1.25 var(--qinglong-font);
  letter-spacing:2px
}
.heading h1 span {
  font:12px var(--qinglong-font);
  letter-spacing:0;
  margin-left:10px;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:4px;
  padding:3px 6px
}
.heading p {
  color:var(--muted);
  font-size:12px;
  margin-top:5px
}
.header-actions {
  margin-left:auto;
  display:flex;
  gap:8px
}
.edition {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  margin:20px 0 16px;
  color:var(--muted)
}
.edition strong {
  color:var(--text);
  font-weight:500
}
.edition-dot {
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--accent)
}
.edition-note {
  margin-left:auto
}
.metrics {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  margin-bottom:20px;
  padding:17px 0
}
.metrics>div {
  display:flex;
  flex-direction:column;
  padding:0 24px;
  border-right:1px solid var(--line)
}
.metrics>div:last-child {
  border:0
}
.metrics span,.metrics em {
  color:var(--muted);
  font-size:12px;
  font-style:normal
}
.metrics strong {
  font:500 32px/1.5 var(--qinglong-font);
  letter-spacing:-.5px
}
.metrics strong small {
  font-size:18px;
  margin-right:5px
}
.metrics b {
  font-weight:500
}
.metrics .text-button {
  text-align:left;
  font-size:12px
}
.play-layout {
  display:grid;
  grid-template-columns:238px minmax(0,1fr);
  gap:20px
}
.panel {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:20px
}
.section-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px
}
.section-heading h2 {
  font-size:17px
}
.section-heading>span {
  font-size:11px;
  color:var(--muted)
}
.subtle {
  font-size:12px;
  color:var(--muted);
  margin:4px 0 15px
}
.milestones {
  padding:19px 17px
}
.milestone {
  position:relative;
  padding:11px 0 11px 23px;
  border-left:1px solid var(--line);
  margin-left:8px
}
.milestone:last-child {
  padding-bottom:0
}
.milestone:before {
  content:'';
  position:absolute;
  width:9px;
  height:9px;
  border:2px solid var(--line-strong);
  background:var(--panel);
  border-radius:50%;
  left:-5px;
  top:17px
}
.milestone.reached:before {
  border-color:var(--accent);
  background:var(--accent)
}
.milestone-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px
}
.milestone-top strong {
  font:600 20px var(--qinglong-font)
}
.milestone p {
  font-size:12px;
  color:var(--text-secondary);
  line-height:1.6;
  max-width:156px
}
.milestone .claim {
  font-size:11px;
  padding:1px 7px;
  min-height:26px;
  color:var(--accent)
}
.milestone small {
  color:var(--muted);
  font-size:10px
}
.milestone.done {
  opacity:.6
}
.pool-panel {
  border:1px solid var(--treasure-line);
  border-radius:14px;
  background:var(--treasure-bg);
  color:var(--treasure-ink);
  padding:23px 25px 14px;
  box-shadow:0 8px 24px rgba(13,41,57,.1)
}
.pool-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:21px
}
.eyebrow {
  font-size:10px;
  letter-spacing:2px;
  color:var(--muted)
}
.pool-heading .eyebrow {
  color:var(--gold)
}
.pool-heading h2 {
  font:500 27px/1.5 var(--qinglong-font);
  letter-spacing:2px
}
.pool-tools {
  display:flex;
  gap:8px
}
.pool-tools button {
  border-color:var(--treasure-line);
  color:var(--treasure-muted);
  background:transparent;
  font-size:12px
}
.pool-tools button:hover:enabled {
  background:var(--treasure-deep)
}
.pool-tools span {
  margin-left:4px;
  color:var(--gold)
}
.board {
  position:relative;
  border:1px solid var(--gold);
  border-radius:8px;
  padding:15px;
  background:radial-gradient(ellipse at 50% 50%,rgba(117,171,193,.14),transparent 75%),var(--treasure-deep);
  box-shadow:inset 0 0 0 4px rgba(223,190,118,.04)
}
.prize-grid {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  grid-template-rows:140px 195px 140px;
  gap:10px
}
.prize {
  grid-row:var(--row);
  grid-column:var(--column);
  border:1px solid rgba(189,210,221,.17);
  border-radius:7px;
  padding:12px 6px 8px;
  text-align:center;
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.035);
  transition:opacity .2s,border-color .2s
}
.prize img {
  width:43px;
  height:43px;
  border:1px solid var(--gold);
  image-rendering:auto;
  box-shadow:0 2px 10px rgba(0,0,0,.15);
  margin-bottom:9px
}
.prize-name {
  font-size:12px;
  line-height:1.6;
  max-width:135px;
  color:var(--treasure-ink);
  overflow-wrap:anywhere
}
.prize .tier {
  position:absolute;
  top:6px;
  right:6px;
  font-size:10px;
  color:var(--treasure-muted)
}
.prize[data-tier=A] {
  border-color:rgba(223,190,118,.7)
}
.prize[data-tier=A] .tier {
  color:var(--gold)
}
.prize[data-tier=B] .tier {
  color:#edbde0
}
.prize .probability {
  font-size:10px;
  color:var(--treasure-muted);
  margin-top:3px;
  font-variant-numeric:tabular-nums
}
.prize.won {
  opacity:.38
}
.prize.won:after {
  content:'已获得';
  position:absolute;
  bottom:12px;
  background:var(--treasure-deep);
  color:var(--gold);
  padding:1px 7px;
  font-size:11px;
  border-radius:3px
}
.prize.latest {
  opacity:1;
  box-shadow:0 0 0 1px var(--gold),0 0 18px rgba(223,190,118,.15)
}
.draw-center {
  position:absolute;
  top:165px;
  left:calc(20% + 18px);
  right:calc(20% + 18px);
  height:195px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center
}
.round-label {
  color:var(--treasure-muted);
  font-size:12px;
  letter-spacing:1px
}
.round-value {
  color:var(--gold-light);
  font:42px/1.1 var(--qinglong-font);
  margin:4px 0
}
.round-value span {
  font-size:14px;
  color:var(--treasure-muted);
  margin-left:8px
}
.egg-dots {
  display:flex;
  gap:7px;
  margin:7px 0 12px
}
.egg-dot {
  width:9px;
  height:12px;
  border:1px solid var(--treasure-line);
  border-radius:50% 50% 45% 45%
}
.egg-dot.open {
  background:var(--gold);
  border-color:var(--gold-light);
  box-shadow:0 0 5px rgba(223,190,118,.35)
}
button.gold-button {
  border:1px solid var(--gold);
  border-radius:7px;
  background:linear-gradient(110deg,var(--gold-light),var(--gold));
  color:var(--gold-ink);
  font-weight:600;
  box-shadow:0 3px 7px rgba(0,0,0,.12);
  padding:9px 22px
}
button.gold-button:hover:enabled {
  background:var(--gold-light)
}
.draw-center .gold-button {
  min-width:205px
}
.finish-pool {
  border:0;
  background:transparent;
  color:var(--treasure-muted);
  font-size:11px;
  min-height:27px;
  padding:2px 8px
}
.finish-pool:hover:enabled {
  color:var(--gold);
  background:transparent
}
.last-result {
  font-size:11px;
  color:var(--gold-light);
  line-height:1.5;
  margin-top:2px;
  max-width:95%;
  min-height:17px
}
.pool-footer {
  display:flex;
  flex-wrap:wrap;
  gap:8px 18px;
  align-items:center;
  margin-top:12px;
  color:var(--treasure-muted);
  font-size:11px
}
.pool-footer label {
  display:flex;
  align-items:center;
  gap:6px
}
.pool-footer input {
  min-height:0;
  accent-color:var(--gold)
}
.pool-footer select {
  background:var(--treasure-bg);
  color:var(--treasure-muted);
  border-color:var(--treasure-line);
  font-size:11px;
  min-height:30px;
  max-width:145px
}
.pool-footer button.text-button {
  color:var(--gold);
  margin-left:auto;
  font-size:12px
}
.below {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin-top:20px
}
.analysis-controls {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0
}
.analysis-controls label {
  font-size:12px
}
.analysis-controls select {
  min-height:36px;
  font-size:12px
}
.analysis-controls button {
  min-height:36px;
  font-size:12px;
  background:var(--accent);
  color:var(--panel)
}
.analysis-controls button:hover:enabled {
  background:var(--accent-strong)
}
.analysis-result {
  min-height:111px;
  display:flex;
  flex-direction:column;
  justify-content:center
}
.analysis-result>p {
  font-size:12px;
  color:var(--muted)
}
.estimate-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:5px 0 10px
}
.estimate-grid span {
  display:block;
  color:var(--muted);
  font-size:11px
}
.estimate-grid strong {
  font:24px var(--qinglong-font);
  color:var(--accent)
}
.distribution {
  height:6px;
  border-radius:4px;
  background:var(--soft);
  margin:8px 0;
  overflow:hidden
}
.distribution span {
  display:block;
  height:100%;
  background:var(--accent);
  min-width:1px
}
.analysis-note {
  font-size:11px;
  color:var(--muted);
  margin-top:12px
}
.history-list {
  max-height:233px;
  overflow:auto;
  margin-top:14px
}
.empty {
  font-size:12px;
  color:var(--muted);
  padding:32px 0
}
.history-row {
  display:grid;
  grid-template-columns:45px 1fr 84px;
  gap:10px;
  align-items:center;
  border-bottom:1px solid var(--line);
  padding:9px 0;
  font-size:12px
}
.history-row>span {
  color:var(--muted);
  font-size:10px
}
.history-row p {
  font-size:12px
}
.history-row small {
  display:block;
  color:var(--muted);
  font-size:10px
}
.history-row>div:last-child {
  text-align:right
}
.page-footer {
  padding:20px 0 10px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  font-size:11px;
  color:var(--muted)
}
.page-footer button {
  font-size:11px
}
.toast {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  padding:11px 20px;
  background:var(--text);
  color:var(--panel);
  box-shadow:var(--shadow-lg);
  border-radius:8px;
  z-index:100;
  max-width:calc(100% - 32px);
  width:max-content;
  font-size:13px
}
.toast[hidden] {
  display:none
}
dialog {
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  color:var(--text);
  padding:25px;
  max-width:760px;
  width:calc(100% - 32px);
  max-height:85vh;
  overflow:auto;
  box-shadow:var(--shadow-float)
}
dialog::backdrop {
  background:rgba(13,41,57,.6)
}
.dialog-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px
}
.dialog-heading h2 {
  font-size:23px
}
.close {
  font-size:24px;
  border:0;
  background:transparent;
  padding:0 5px;
  min-width:35px
}
.tier-tabs {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin:16px 0
}
.tier-tabs button {
  font-size:12px
}
.tier-tabs button[aria-pressed=true] {
  background:var(--accent-soft);
  border-color:var(--accent);
  color:var(--accent)
}
.selection-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  min-height:200px
}
.select-item {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:12px 6px;
  position:relative;
  min-height:117px
}
.select-item img {
  width:36px;
  height:36px
}
.select-item span {
  font-size:11px;
  line-height:1.5
}
.select-item[aria-pressed=true] {
  background:var(--accent-soft);
  border-color:var(--accent)
}
.select-item[aria-pressed=true]:after {
  content:'✓';
  position:absolute;
  top:3px;
  right:7px;
  color:var(--accent);
  font-size:14px
}
.dialog-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:20px
}
.dialog-footer>span {
  font-size:12px;
  color:var(--muted)
}
.card-balances {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin:16px 0
}
.card-balances>div {
  border:1px solid var(--line);
  border-radius:8px;
  padding:10px;
  text-align:center;
  font-size:12px;
  color:var(--muted)
}
.card-balances strong {
  display:block;
  color:var(--text);
  font:24px var(--qinglong-font)
}
.exchange-row {
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 0;
  border-bottom:1px solid var(--line)
}
.exchange-row img {
  width:32px;
  height:32px
}
.exchange-row div {
  flex:1
}
.exchange-row p {
  font-size:12px
}
.exchange-row small {
  font-size:11px;
  color:var(--muted)
}
.exchange-row button {
  min-height:32px;
  font-size:11px;
  padding:4px 10px
}
.simulation-cards {
  margin-top:18px;
  font-size:12px;
  color:var(--muted)
}
.simulation-cards button {
  margin:5px 4px 0 0;
  min-height:32px;
  font-size:11px
}
.simulation-cards summary {
  cursor:pointer
}
.simulation-cards p {
  margin:7px 0
}
#rulesDialog p,#rulesDialog li {
  font-size:13px;
  margin:10px 0;
  color:var(--text-secondary)
}
#rulesDialog ul {
  padding-left:19px
}
#rulesDialog h3 {
  font-size:15px;
  margin:17px 0 8px
}
.table-scroll {
  overflow:auto
}
table {
  width:100%;
  border-collapse:collapse;
  text-align:center;
  font-size:12px
}
td,th {
  padding:7px;
  border-bottom:1px solid var(--line);
  white-space:nowrap
}
th {
  color:var(--muted);
  font-weight:400
}
#purchaseDialog,#confirmDialog {
  max-width:460px
}
#purchaseForm {
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap
}
#purchaseAmount {
  width:100px;
  padding:6px
}
#confirmMessage {
  color:var(--text-secondary);
  font-size:13px;
  margin-top:14px
}
@media(min-width:1450px) {
  .shell {
    padding-top:35px
  }
}
@media(max-width:1050px) {
  .shell {
    padding:20px
  }
  .play-layout {
    grid-template-columns:205px minmax(0,1fr);
    gap:14px
  }
  .pool-panel {
    padding:19px 15px 12px
  }
  .pool-heading h2 {
    font-size:23px
  }
  .pool-tools {
    flex-direction:column;
    gap:5px
  }
  .pool-tools button {
    min-height:30px;
    padding:3px 10px
  }
  .prize-grid {
    gap:6px;
    grid-template-rows:140px 195px 140px
  }
  .prize {
    padding:8px 4px
  }
  .prize-name {
    font-size:11px
  }
  .milestones {
    padding:17px 13px
  }
  .pool-footer {
    gap:8px
  }
  .pool-footer .text-button {
    margin-left:0
  }
  .metrics>div {
    padding:0 17px
  }
}
@media(max-width:760px) {
  .shell {
    padding:16px 12px
  }
  .header {
    gap:12px;
    flex-wrap:wrap
  }
  .brand {
    font-size:0;
    gap:0
  }
  .brand span {
    display:none
  }
  .heading h1 {
    font-size:27px
  }
  .header-actions {
    gap:4px
  }
  .header-actions button {
    font-size:11px;
    min-height:35px;
    padding:4px 7px
  }
  .heading p {
    font-size:11px
  }
  .edition {
    margin-top:16px;
    flex-wrap:wrap;
    gap:6px
  }
  .edition-note {
    width:100%;
    margin-left:14px
  }
  .metrics {
    grid-template-columns:repeat(2,1fr);
    padding:0;
    margin-bottom:15px
  }
  .metrics>div {
    padding:11px 16px
  }
  .metrics>div:nth-child(2) {
    border-right:0
  }
  .metrics>div:nth-child(-n+2) {
    border-bottom:1px solid var(--line)
  }
  .metrics strong {
    font-size:29px
  }
  .play-layout {
    display:flex;
    flex-direction:column;
    gap:15px
  }
  .pool-panel {
    order:0;
    padding:16px 10px 12px
  }
  .milestones {
    order:1
  }
  .pool-heading {
    display:block;
    margin:0 4px 16px
  }
  .pool-heading h2 {
    white-space:nowrap
  }
  .pool-tools {
    margin-top:9px
  }
  .pool-tools {
    flex-direction:row
  }
  .pool-tools button {
    min-height:35px;
    padding:4px 8px
  }
  .pool-heading h2 {
    font-size:23px
  }
  .pool-heading .eyebrow {
    font-size:8px;
    letter-spacing:1.5px
  }
  .board {
    padding:8px
  }
  .prize-grid {
    grid-template-columns:repeat(4,minmax(0,1fr));
    grid-template-rows:125px 95px 95px 125px;
    gap:6px
  }
  .prize {
    grid-row:var(--mobile-row);
    grid-column:var(--mobile-column)
  }
  .prize img {
    width:34px;
    height:34px;
    margin-bottom:7px
  }
  .prize-name {
    font-size:10px;
    line-height:1.5
  }
  .prize .tier {
    font-size:8px;
    right:3px;
    top:3px
  }
  .prize .probability {
    font-size:8px
  }
  .draw-center {
    top:139px;
    left:calc(25% + 10px);
    right:calc(25% + 10px);
    height:196px
  }
  .round-label {
    font-size:10px;
    letter-spacing:0
  }
  .round-value {
    font-size:34px
  }
  .draw-center .gold-button {
    min-width:0;
    width:100%;
    font-size:12px;
    padding:9px 3px
  }
  .last-result {
    font-size:9px
  }
  .pool-footer {
    padding:0 3px;
    gap:4px 13px
  }
  .pool-footer select {
    font-size:10px;
    max-width:132px
  }
  .pool-footer .text-button {
    width:100%;
    text-align:left;
    margin-top:3px
  }
  .milestones .subtle {
    margin-bottom:5px
  }
  #milestoneList {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:0 10px
  }
  .milestone {
    padding:10px 0 10px 17px
  }
  .milestone p {
    max-width:none
  }
  .milestone-top {
    justify-content:flex-start;
    gap:12px
  }
  .below {
    grid-template-columns:1fr;
    gap:15px;
    margin-top:15px
  }
  .panel {
    padding:17px
  }
  .history-list {
    max-height:210px
  }
  .page-footer {
    flex-wrap:wrap;
    gap:3px 12px;
    padding-top:17px
  }
  .page-footer>span:nth-child(2) {
    order:2;
    width:100%
  }
  .page-footer button {
    margin-left:auto
  }
  .selection-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px
  }
  .tier-tabs {
    gap:5px
  }
  .tier-tabs button {
    padding:6px 3px
  }
  .dialog-heading h2 {
    font-size:21px
  }
  dialog {
    padding:18px
  }
  .dialog-footer {
    flex-wrap:wrap
  }
  .card-balances {
    gap:5px
  }
  .card-balances>div {
    padding:7px;
    font-size:11px
  }
  .exchange-row {
    gap:8px
  }
  .metrics span,.metrics em {
    font-size:11px
  }
  .metrics .text-button {
    font-size:11px
  }
}
@media(max-width:360px) {
  .header-actions {
    width:100%;
    margin-left:42px
  }
  .pool-tools {
    flex-direction:column
  }
  .prize-grid {
    grid-template-rows:130px 95px 95px 130px
  }
  .draw-center {
    top:144px
  }
  .prize-name {
    font-size:9px
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    transition:none!important;
    animation:none!important
  }
}
