/* 猫头鹰导师能力报告：蓝色魔法书 + 羊皮卷，与游戏内像素冒险界面统一。 */
#codequest-capability-report {
  --cr-ink: #3b2a18;
  --cr-blue: #315d83;
  --cr-blue-dark: #173650;
  --cr-gold: #f7c95b;
  --cr-paper: #fff1be;
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--cr-ink);
  background: rgba(8, 20, 38, .82);
  backdrop-filter: blur(4px);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  animation: cqCrFade .18s ease-out;
}

#codequest-capability-report * { box-sizing: border-box; }

.cq-cr-shell {
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cr-paper);
  border: 7px solid #754421;
  outline: 4px solid #2b1a10;
  box-shadow: 0 11px 0 #1d120c, 0 24px 55px rgba(0,0,0,.5), inset 0 0 0 3px #d59b42;
  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: cqCrOpen .25s steps(4, end);
}

.cq-cr-header {
  position: relative;
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 68px 12px 130px;
  color: #fff8d9;
  background: var(--cr-blue);
  border-bottom: 6px solid #754421;
  box-shadow: inset 0 4px 0 #6286a3, inset 0 -4px 0 var(--cr-blue-dark);
}

.cq-cr-header img {
  position: absolute;
  left: 18px;
  bottom: -13px;
  width: 104px;
  height: 104px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(4px 5px 0 rgba(20, 25, 33, .35));
}

.cq-cr-header span { color: #ffe394; font-size: 11px; font-weight: 900; letter-spacing: 2px; }
.cq-cr-header h2 { margin: 2px 0; color: #fff9dc; font-size: 28px; line-height: 1.1; letter-spacing: 3px; text-shadow: 3px 3px 0 #173650; }
.cq-cr-header p { margin: 5px 0 0; color: #d8efff; font-size: 13px; font-weight: 800; }

.cq-cr-close {
  position: absolute;
  right: 16px;
  top: 17px;
  width: 38px;
  height: 38px;
  border: 3px solid #4a2c17;
  border-radius: 0;
  color: #402916;
  background: var(--cr-gold);
  box-shadow: 3px 3px 0 #15283a;
  font-weight: 900;
  cursor: pointer;
}

.cq-cr-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(360px, 1.05fr);
  gap: 15px;
  padding: 18px 20px 12px;
  overflow-y: auto;
  background-image: repeating-linear-gradient(0deg, transparent 0 8px, rgba(96, 60, 24, .06) 9px 10px);
  scrollbar-color: #a66a31 #f4dda2;
}

.cq-cr-radar-card,
.cq-cr-data {
  min-width: 0;
  padding: 15px;
  background: #fff8db;
  border: 3px solid #a46931;
  box-shadow: inset 0 0 0 3px #efd49b, 3px 3px 0 #69411f;
}

.cq-cr-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cq-cr-section-title small { color: #a05431; font-size: 9px; font-weight: 900; letter-spacing: 2px; }
.cq-cr-section-title h3 { margin: 1px 0 0; color: #294f69; font-size: 19px; }
.cq-cr-section-title > span { margin-top: 7px; color: #78502d; font-size: 11px; font-weight: 800; }

.cq-cr-radar { width: 100%; max-height: 300px; margin: 0 auto; overflow: visible; }
.cq-cr-grid-line { fill: rgba(74, 139, 183, .055); stroke: #b5c5c6; stroke-width: 1.5; }
.cq-cr-grid line { stroke: #c7cebf; stroke-width: 1.3; }
.cq-cr-area { fill: rgba(69, 151, 201, .35); stroke: #266fa0; stroke-width: 3; filter: drop-shadow(2px 3px 0 rgba(42, 83, 110, .16)); }
.cq-cr-radar circle { fill: #f6c657; stroke: #754421; stroke-width: 2; }
.cq-cr-labels text { fill: #4c3824; font-size: 11px; font-weight: 900; }
.cq-cr-labels .cq-cr-score { fill: #26749e; font-size: 12px; }
.cq-cr-note { margin: -2px 0 0; color: #7b6040; font-size: 10px; line-height: 1.5; text-align: center; }

.cq-cr-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.cq-cr-stat {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f5dfa8;
  border: 2px solid #9f642f;
  box-shadow: inset 0 0 0 2px #fff1c5, 2px 2px 0 #6b441f;
}
.cq-cr-stat-icon { flex: 0 0 30px; color: #b46032; font-size: 24px; text-align: center; }
.cq-cr-stat small { display: block; color: #7c552e; font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.cq-cr-stat strong { display: block; margin: 1px 0; color: #294f69; font-size: 18px; }
.cq-cr-stat p { margin: 0; color: #836849; font-size: 9px; line-height: 1.35; }

.cq-cr-insight {
  position: relative;
  margin-top: 12px;
  padding: 21px 14px 13px;
  color: #fff7cf;
  background: #486b50;
  border: 3px solid #294b39;
  box-shadow: 3px 3px 0 #1f382b;
}
.cq-cr-insight > span { position: absolute; top: -11px; left: 12px; padding: 3px 9px; color: #493018; background: #f5ca62; border: 2px solid #6c421f; font-size: 10px; font-weight: 900; }
.cq-cr-insight h4 { margin: 0 0 5px; color: #ffe896; font-size: 15px; }
.cq-cr-insight p { margin: 0; font-size: 12px; line-height: 1.65; font-weight: 700; }

.cq-cr-shell footer { display: flex; justify-content: flex-end; padding: 5px 20px 18px; }
.cq-cr-confirm { min-width: 138px; padding: 10px 18px; border: 3px solid #3e2416; border-radius: 0; color: #fff8da; background: #4e7d55; box-shadow: 4px 4px 0 #26160e; font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; }
.cq-cr-confirm:hover, .cq-cr-close:hover { filter: brightness(1.08); transform: translate(-1px, -1px); }
.cq-cr-confirm:active, .cq-cr-close:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #26160e; }

@media (max-width: 790px) {
  #codequest-capability-report { padding: 9px; }
  .cq-cr-shell { width: calc(100vw - 18px); max-height: calc(100vh - 18px); border-width: 5px; }
  .cq-cr-header { min-height: 88px; padding: 10px 54px 9px 94px; }
  .cq-cr-header img { left: 6px; width: 84px; height: 84px; }
  .cq-cr-header h2 { font-size: 21px; }
  .cq-cr-body { grid-template-columns: 1fr; padding: 12px; }
  .cq-cr-radar { max-height: 270px; }
}

@media (max-width: 430px) {
  .cq-cr-stat-grid { grid-template-columns: 1fr; }
  .cq-cr-section-title > span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #codequest-capability-report, .cq-cr-shell { animation: none; }
}

@keyframes cqCrFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cqCrOpen { from { transform: scale(.92) translateY(14px); } to { transform: scale(1) translateY(0); } }
