/* 独立通关报告：像素冒险 + 羊皮卷视觉，不依赖游戏内部样式。 */
#codequest-level-report {
  --lr-ink: #352414;
  --lr-wood: #754421;
  --lr-dark-wood: #3e2416;
  --lr-gold: #f6c758;
  --lr-paper: #fff0bd;
  position: fixed; inset: 0; z-index: 2147483000;
  display: grid; place-items: center; padding: 18px;
  background: rgba(13, 28, 52, .78);
  backdrop-filter: blur(3px);
  animation: cq-lr-fade .2s ease-out;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

#codequest-level-report::before,
#codequest-level-report::after {
  content: "✦"; position: fixed; color: var(--lr-gold); font-size: 28px;
  text-shadow: 22px 14px 0 rgba(246,199,88,.36), -19px 35px 0 rgba(246,199,88,.22);
  animation: cq-lr-twinkle 1.8s steps(2, end) infinite;
}
#codequest-level-report::before { left: 9%; top: 18%; }
#codequest-level-report::after { right: 12%; bottom: 19%; animation-delay: .9s; }

.cq-lr-shell {
  position: relative; width: min(760px, calc(100vw - 36px)); max-height: calc(100vh - 36px);
  display: flex; flex-direction: column; overflow: hidden;
  color: var(--lr-ink); background: var(--lr-paper);
  border: 8px solid var(--lr-wood); outline: 4px solid var(--lr-dark-wood);
  box-shadow: 0 10px 0 #21150f, 0 18px 38px rgba(0,0,0,.45), inset 0 0 0 4px #d19a43;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  animation: cq-lr-pop .28s steps(4, end);
}

.cq-lr-shell::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: repeating-linear-gradient(0deg, transparent 0 7px, rgba(90,54,20,.13) 8px 9px);
}

.cq-lr-header {
  position: relative; flex: 0 0 auto; min-height: 116px; display: flex; align-items: center;
  padding: 14px 28px 12px 152px; color: #fff8d9;
  background: #315779; border-bottom: 6px solid var(--lr-wood);
  box-shadow: inset 0 -3px 0 #1f3c5c, inset 0 3px 0 #5f82a0;
}

.cq-lr-owl {
  position: absolute; z-index: 2; left: 20px; bottom: -18px; width: 116px; height: 116px;
  object-fit: contain; image-rendering: pixelated; filter: drop-shadow(4px 5px 0 rgba(31,25,22,.36));
}

.cq-lr-kicker { color: #ffe493; font-size: 12px; font-weight: 800; letter-spacing: 2px; }
.cq-lr-title { margin: 2px 0 1px; color: #fff8d9; font-size: 30px; line-height: 1.15; letter-spacing: 4px; text-shadow: 3px 3px 0 #17324c; }
.cq-lr-level { display: inline-block; margin-top: 5px; padding: 3px 9px; color: #31506b; background: #ffe493; border: 2px solid #b97b2c; font-size: 13px; font-weight: 800; }

.cq-lr-body { position: relative; overflow-y: auto; padding: 23px 26px 14px; scrollbar-color: #a66a31 #f4dda2; }
.cq-lr-stats { margin: 0 0 16px; }
.cq-lr-stat-grid { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 10px; }
.cq-lr-stat {
  min-width: 0; padding: 10px 12px; background: #f7dda0; border: 3px solid #9b602d;
  box-shadow: inset 0 0 0 2px #fff1c3, 3px 3px 0 #62401f;
}
.cq-lr-stat-label { display: block; color: #75502b; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.cq-lr-stat strong { display: block; margin: 2px 0 6px; color: #294d60; font-size: 18px; }
.cq-lr-stat-icon { float: right; font-size: 20px; }
.cq-lr-bar { height: 9px; padding: 2px; background: #75502b; box-shadow: inset 2px 2px 0 #3f2a17; }
.cq-lr-bar i { display: block; height: 100%; background: #70b85d; box-shadow: inset 0 -2px 0 #3f7f48; transition: width .6s steps(8, end); }
.cq-lr-time { background: #d7e9d0; }
.cq-lr-time strong { margin-top: 9px; font-size: 20px; }

.cq-lr-path {
  margin-top: 12px; padding: 9px 12px; color: #fdf5cc; background: #486b50;
  border: 3px solid #294b39; box-shadow: 3px 3px 0 #1d382b; font-size: 13px; font-weight: 700;
}
.cq-lr-path span { margin-right: 8px; color: #ffe072; }

.cq-lr-letter {
  position: relative; padding: 25px 24px 18px; color: #4b3420; background: #fff7d5;
  border: 3px solid #bd8542; box-shadow: inset 0 0 0 3px #efd49b, 3px 3px 0 #70431f;
  font-size: 15px; line-height: 1.85; text-align: left;
}
.cq-lr-letter-label { position: absolute; top: -13px; left: 18px; padding: 3px 13px; color: #fff3bf; background: #a65732; border: 2px solid #62301e; font-size: 12px; font-weight: 800; letter-spacing: 2px; }
.cq-lr-letter p { margin: 5px 0; }

.cq-lr-loading { min-height: 126px; display: grid; place-items: center; align-content: center; gap: 6px; color: #31506b; background: #fff7d5; border: 3px dashed #b97b2c; text-align: center; }
.cq-lr-loading strong { font-size: 17px; }
.cq-lr-loading span { color: #795a35; font-size: 13px; }
.cq-lr-feather { color: #e19a37; font-size: 30px; animation: cq-lr-bob 1s steps(3, end) infinite; }
.cq-lr-dots { display: inline-block; width: 20px; overflow: hidden; vertical-align: bottom; animation: cq-lr-dots 1.2s steps(4,end) infinite; }

.cq-lr-controls { position: relative; flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 12px; padding: 6px 26px 22px; }
.cq-lr-button { min-width: 128px; padding: 10px 17px; border: 3px solid #3e2416; border-radius: 0; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 4px 4px 0 #26160e; transition: transform .08s, box-shadow .08s, filter .12s; }
.cq-lr-button:hover { filter: brightness(1.08); transform: translate(-1px,-1px); box-shadow: 5px 5px 0 #26160e; }
.cq-lr-button:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 #26160e; }
.cq-lr-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.cq-lr-report { color: #463018; background: #f3c858; }
.cq-lr-close { color: #fff9d7; background: #4e7d55; }

@media (max-width: 640px) {
  #codequest-level-report { padding: 10px; }
  .cq-lr-shell { width: calc(100vw - 20px); max-height: calc(100vh - 20px); border-width: 5px; }
  .cq-lr-header { min-height: 88px; padding: 11px 12px 10px 96px; }
  .cq-lr-owl { left: 7px; width: 84px; height: 84px; }
  .cq-lr-title { font-size: 22px; }
  .cq-lr-body { padding: 18px 13px 10px; }
  .cq-lr-stat-grid { grid-template-columns: 1fr 1fr; }
  .cq-lr-time { grid-column: 1 / -1; }
  .cq-lr-controls { padding: 6px 13px 15px; }
  .cq-lr-button { flex: 1; min-width: 0; padding: 9px 7px; }
}

@media (prefers-reduced-motion: reduce) { #codequest-level-report, .cq-lr-shell, .cq-lr-feather, .cq-lr-dots { animation: none; } }
@keyframes cq-lr-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cq-lr-pop { from { transform: scale(.9) translateY(16px); } to { transform: scale(1) translateY(0); } }
@keyframes cq-lr-twinkle { 50% { opacity: .35; } }
@keyframes cq-lr-bob { 50% { transform: translateY(-7px) rotate(8deg); } }
@keyframes cq-lr-dots { from { width: 0; } to { width: 20px; } }
