/* Native grading-result page. The compiled Taro route renders completed data;
 * the desktop helper owns the pending/failed long-text compatibility state. */
body.route-grade-result #app .min-h-screen {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 36px clamp(24px, 4vw, 64px) 72px;
  box-sizing: border-box;
  overflow-x: hidden;
  background: #0d0d10 !important;
  color: #e7efed;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 !important;
  gap: 18px !important;
  box-sizing: border-box;
}

/* Hide the empty native Navigation banner; grade-result.js injects a clear
 * “← 返回批改” control instead. */
body.route-grade-result #app .min-h-screen:has(> .px-4.py-6) > :first-child:not(.px-4):not(#desktop-grade-result-back) {
  display: none !important;
}

/* Fallback for the compiled native page: the result container is always the
 * second child, so its preceding desktop-only Navigation is safe to remove. */
body.route-grade-result #app .min-h-screen > :first-child:has(+ .px-4.py-6):not(#desktop-grade-result-back) {
  display: none !important;
}

body.route-grade-result #desktop-grade-result-back,
body.route-grade-result .desktop-grade-result-back {
  display: flex !important;
  align-items: center;
  margin: 0 0 8px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.route-grade-result #desktop-grade-result-back button,
body.route-grade-result .desktop-grade-result-back button {
  min-height: 36px !important;
  padding: 0 14px !important;
  border: 1px solid #2d5c57 !important;
  border-radius: 5px !important;
  background: rgba(53, 214, 197, .08) !important;
  color: #74d9cc !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer;
}

body.route-grade-result #desktop-grade-result-back button:hover,
body.route-grade-result .desktop-grade-result-back button:hover {
  background: rgba(53, 214, 197, .16) !important;
  border-color: #35d6c5 !important;
}

body.route-grade-result.desktop-grade-result-job-active #app .min-h-screen > .px-4.py-6 {
  display: none !important;
}

body.route-grade-result .desktop-grade-result-job {
  width: min(760px, 100%);
  min-height: 230px;
  margin: 36px auto 0;
  padding: 34px 38px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  box-sizing: border-box;
  border: 1px solid #2d5c57;
  border-radius: 8px;
  background: #121719;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

body.route-grade-result .desktop-grade-result-job-icon {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(53, 214, 197, .18);
  border-top-color: #35d6c5;
  border-radius: 50%;
  animation: desktop-grade-result-spin 1s linear infinite;
}

body.route-grade-result .desktop-grade-result-job strong {
  display: block;
  color: #eefaf7;
  font-size: 20px;
  line-height: 1.35;
}

body.route-grade-result .desktop-grade-result-job p {
  margin: 10px 0 6px;
  color: #c9d7d4;
  font-size: 16px;
  line-height: 1.75;
}

body.route-grade-result .desktop-grade-result-job small {
  color: #829895;
  font-size: 13px;
  line-height: 1.6;
}

body.route-grade-result .desktop-grade-result-job button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #39776f !important;
  background: rgba(53, 214, 197, .1) !important;
  color: #74d9cc;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

body.route-grade-result .desktop-grade-result-job-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

body.route-grade-result .desktop-grade-result-job.is-failed .desktop-grade-result-job-icon {
  border-color: #8b4b4b;
  animation: none;
  position: relative;
}

body.route-grade-result .desktop-grade-result-job.is-failed .desktop-grade-result-job-icon::before,
body.route-grade-result .desktop-grade-result-job.is-failed .desktop-grade-result-job-icon::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 20px;
  width: 24px;
  height: 2px;
  background: #e88989;
}

body.route-grade-result .desktop-grade-result-job.is-failed .desktop-grade-result-job-icon::before { transform: rotate(45deg); }
body.route-grade-result .desktop-grade-result-job.is-failed .desktop-grade-result-job-icon::after { transform: rotate(-45deg); }

@keyframes desktop-grade-result-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  body.route-grade-result .desktop-grade-result-job {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 26px 22px;
  }
  body.route-grade-result .desktop-grade-result-job-icon { width: 40px; height: 40px; }
  body.route-grade-result .desktop-grade-result-job-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-self: start;
  }
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:first-child {
  min-height: 184px;
  box-sizing: border-box;
  border: 1px solid #2d5c57 !important;
  border-radius: 8px !important;
  background: linear-gradient(115deg, #10221f, #121619 62%) !important;
  box-shadow: inset 0 1px rgba(143, 233, 220, .06), 0 12px 32px rgba(0, 0, 0, .16) !important;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:first-child .text-primary-foreground {
  color: #eefaf7 !important;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:first-child [class*="rounded-full"] {
  border: 1px solid rgba(132, 226, 213, .25) !important;
  background: rgba(91, 200, 187, .12) !important;
}

body.route-grade-result #app .bg-gradient-primary {
  border: 1px solid #27736b !important;
  border-radius: 7px !important;
  background: #163b38 !important;
  box-shadow: none !important;
}

body.route-grade-result #app .rounded-2xl,
body.route-grade-result #app .rounded-xl {
  border-radius: 7px !important;
}

body.route-grade-result #app [style*="rgba(255,255,255"],
body.route-grade-result #app [style*="rgba(255,240,245"],
body.route-grade-result #app [style*="rgba(255,248,220"] {
  border: 1px solid #2a3034 !important;
  background: #121417 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.route-grade-result #app .text-foreground { color: #e8f1ef !important; }
body.route-grade-result #app .text-muted-foreground { color: #98aaa7 !important; }
body.route-grade-result #app .text-primary { color: #74d9cc !important; }
body.route-grade-result #app .text-accent { color: #78d7ce !important; }
body.route-grade-result #app .bg-secondary,
body.route-grade-result #app .bg-muted { background: #181b1e !important; }

body.route-grade-result #app button {
  border: 1px solid #343a3d !important;
  border-radius: 5px !important;
  box-shadow: none !important;
}

body.route-grade-result #app .grid > div[style*="conic-gradient"] {
  border: 1px solid #2a3034 !important;
  background: #121417 !important;
  box-shadow: none !important;
}

body.route-grade-result #app .grid > .desktop-grade-score-unavailable:nth-child(1) > div:first-child {
  background: conic-gradient(#41e3ce 0 22%, #293334 22% 100%) !important;
}

body.route-grade-result #app .grid > .desktop-grade-score-unavailable:nth-child(2) > div:first-child {
  background: conic-gradient(#68b9ff 0 22%, #293334 22% 100%) !important;
}

body.route-grade-result #app .grid > .desktop-grade-score-unavailable:nth-child(3) > div:first-child {
  background: conic-gradient(#b49aff 0 22%, #293334 22% 100%) !important;
}

body.route-grade-result #app .grid > .desktop-grade-score-unavailable:nth-child(4) > div:first-child {
  background: conic-gradient(#f5c76c 0 22%, #293334 22% 100%) !important;
}

body.route-grade-result #app .grid > .desktop-grade-score-unavailable:nth-child(5) > div:first-child {
  background: conic-gradient(#f29aae 0 22%, #293334 22% 100%) !important;
}

body.route-grade-result #app .desktop-grade-score-unavailable > div:first-child > div {
  background: #17191d !important;
  color: #b7c9c6 !important;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:nth-child(2) > p {
  margin: 2px 0 0 !important;
  color: #eef6f4 !important;
  font-size: 18px !important;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:nth-child(2) .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:nth-child(2) .grid > div {
  min-width: 0 !important;
  padding: 18px 14px !important;
  border: 1px solid #2a3034 !important;
  border-radius: 7px !important;
  background: #121417 !important;
  box-shadow: none !important;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:nth-child(n+4) {
  border: 1px solid #2a3034 !important;
  border-radius: 7px !important;
  background: #121417 !important;
  box-shadow: none !important;
}

body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:nth-child(n+4) .text-xl {
  font-size: 16px !important;
  line-height: 1.8 !important;
}

@media (max-width: 980px) {
  body.route-grade-result #app .min-h-screen { padding: 24px 14px 48px; }
  body.route-grade-result #app .min-h-screen > .px-4.py-6 > div:nth-child(2) .grid {
    grid-template-columns: 1fr !important;
  }
}
