﻿:root {
  --bg-1: #f7fbff;
  --bg-2: #eef7f1;
  --bg-3: #fff3e4;
  --ink: #10223a;
  --muted: #5b6b7a;
  --soft: #eff3f8;
  --primary: #1976d2;
  --accent: #18b5a6;
  --accent-2: #f59e0b;
  --accent-3: #ef6c57;
  --good: #10b981;
  --warn: #f97316;
  --bad: #ef4444;
  --card: rgba(255, 255, 255, 0.86);
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 24px 60px -40px rgba(15, 23, 42, 0.4);
  --radius: 18px;
  --font-display: "ZCOOL XiaoWei", "Source Han Serif SC", "STSong", serif;
  --font-body: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(140deg, var(--bg-1), var(--bg-2) 40%, var(--bg-3));
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.7;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #a4d8ff, transparent 70%);
  top: -120px;
  left: -120px;
}

.blob-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #c9f7de, transparent 70%);
  bottom: -200px;
  right: -150px;
}

.blob-3 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #ffe2c1, transparent 70%);
  top: 20%;
  right: 5%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 6vw 12px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 24px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.nav a:hover {
  background: rgba(25, 118, 210, 0.12);
  color: var(--primary);
}

.nav a.active {
  background: rgba(25, 118, 210, 0.18);
  color: var(--primary);
  font-weight: 600;
}

main {
  padding: 16px 6vw 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}

body.no-login .hero {
  grid-template-columns: 1fr;
}

.hero-title h1 {
  font-family: var(--font-display);
  font-size: 36px;
  margin-bottom: 8px;
}

.hero-title p {
  color: var(--muted);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 22px;
}

.consent-box {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.6);
  display: grid;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.consent-box h4 {
  color: var(--ink);
  font-size: 14px;
}

.consent-box ul {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.consent-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-head h3 {
  font-size: 18px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(25, 118, 210, 0.12);
  color: var(--primary);
}

.badge.soft {
  background: rgba(16, 185, 129, 0.12);
  color: var(--good);
}

.primary {
  background: linear-gradient(135deg, var(--primary), #3ea0ff);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
}

.primary:disabled,
.ghost:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  font-size: 13px;
}

.switch input {
  accent-color: var(--primary);
}

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-wrap img {
  width: 160px;
  height: 160px;
  background: #f2f4f7;
  border-radius: 14px;
  object-fit: contain;
  border: 1px dashed var(--border);
}

.qr-code {
  font-size: 12px;
  color: var(--muted);
}

.login-info {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: white;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-family: var(--font-display);
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
}

.profile-meta {
  font-size: 12px;
  color: var(--muted);
}

.kv-list {
  display: grid;
  gap: 8px;
}

.kv-list div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.exam-select {
  display: grid;
  gap: 10px;
}

.exam-select label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

select,
input[type="range"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-family: var(--font-body);
}

.exam-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.exam-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.api-config {
  margin-top: 16px;
}

.api-config summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.config-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.config-grid input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.config-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-summary .chart {
  height: 220px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.summary-grid .summary-item {
  background: rgba(25, 118, 210, 0.08);
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
}

.summary-item strong {
  display: block;
  font-size: 16px;
  color: var(--primary);
}

.mini-suggestion p {
  font-size: 14px;
  color: var(--muted);
}

.stamp {
  position: absolute;
  right: 20px;
  bottom: 20px;
  border: 2px dashed rgba(239, 68, 68, 0.6);
  color: rgba(239, 68, 68, 0.8);
  padding: 10px 16px;
  border-radius: 50%;
  transform: rotate(-10deg);
  font-size: 12px;
}

.report-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-title {
  display: flex;
  gap: 16px;
  align-items: center;
}

.section-index {
  font-size: 22px;
  font-family: var(--font-display);
  background: rgba(25, 118, 210, 0.12);
  color: var(--primary);
  padding: 10px 14px;
  border-radius: 14px;
}

.section-title h2 {
  font-family: var(--font-display);
}

.section-title p {
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.chart {
  width: 100%;
  height: 260px;
}

.scroll-x {
  overflow-x: auto;
  padding-bottom: 6px;
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.compare-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.compare-switch select {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  font-size: 12px;
}

.note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
  padding: 10px;
  border-radius: 10px;
}

.line-track {
  position: relative;
  height: 110px;
  background: linear-gradient(90deg, rgba(25, 118, 210, 0.08), rgba(16, 185, 129, 0.12));
  border-radius: 14px;
  overflow: hidden;
  padding: 18px;
}

.line-marker {
  position: absolute;
  bottom: 10px;
  width: 2px;
  height: 60px;
  background: rgba(15, 23, 42, 0.2);
}

.line-marker span {
  position: absolute;
  bottom: 70px;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.line-student {
  position: absolute;
  bottom: 0;
  width: 12px;
  height: 90px;
  background: var(--primary);
  border-radius: 999px;
}

.line-student span {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--primary);
}

.line-detail {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.line-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.line-labels span {
  background: rgba(25, 118, 210, 0.1);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.line-desc {
  color: var(--muted);
}

.goal-list {
  display: grid;
  gap: 10px;
}

.goal-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  font-size: 13px;
}

.goal-item strong {
  color: var(--good);
}

.goal-slider {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.goal-value {
  font-size: 22px;
  color: var(--primary);
  font-family: var(--font-display);
}

.knowledge-list {
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow: auto;
  padding-right: 6px;
}

.knowledge-item {
  background: rgba(15, 23, 42, 0.04);
  padding: 10px;
  border-radius: 12px;
}

.knowledge-item header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: inherit;
}

.question-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 160px;
  overflow: auto;
}

.question-chip {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  font-size: 12px;
  color: var(--muted);
}

.answer-grid {
  display: grid;
  gap: 8px;
}

.answer-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
}

.answer-thumbs {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.thumb-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px -12px rgba(15, 23, 42, 0.3);
}

.thumb-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}

.thumb-item span {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--muted);
}

.answer-card {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.answer-card span {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(25, 118, 210, 0.08);
  font-size: 12px;
  text-align: center;
}

.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.prob-list {
  display: grid;
  gap: 12px;
}

.prob-item {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.prob-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.prob-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.prob-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.image-modal[hidden] {
  display: none;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.image-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 12px;
  max-width: 90vw;
  max-height: 88vh;
  box-shadow: var(--shadow);
  z-index: 1;
  display: grid;
  gap: 8px;
}

.image-modal-content img {
  max-width: 84vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  background: #f3f4f6;
}

.image-modal-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.image-modal-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.12);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}

.footer {
  padding: 40px 6vw 60px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.floating-bar {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 20;
}

.floating-bar.show {
  display: block;
}

.floating-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.floating-content select {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  font-size: 12px;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  z-index: 1000;
}

.toast {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  color: white;
  font-size: 12px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}

.toast.success {
  background: rgba(16, 185, 129, 0.9);
}

.toast.warn {
  background: rgba(249, 115, 22, 0.9);
}

.toast.error {
  background: rgba(239, 68, 68, 0.9);
}

@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
  color: white;
  font-size: 14px;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(25, 118, 210, 0.9);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: none;
  z-index: 900;
  box-shadow: var(--shadow);
}

.back-to-top.show {
  display: grid;
  place-items: center;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.confirm-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 18px;
  width: min(420px, 92vw);
  display: grid;
  gap: 12px;
  z-index: 1;
  box-shadow: var(--shadow);
}

.confirm-modal-content h4 {
  font-size: 16px;
}

.confirm-modal-content p {
  font-size: 13px;
  color: var(--muted);
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.loading-overlay.show {
  display: flex;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  animation: spin 1s linear infinite;
}

.progress-track {
  width: min(360px, 70vw);
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #34d399);
  transition: width 0.2s ease;
}

.progress-text {
  font-size: 12px;
  opacity: 0.9;
}

.progress-detail {
  font-size: 12px;
  opacity: 0.85;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

pre {
  background: rgba(15, 23, 42, 0.04);
  padding: 12px;
  border-radius: 12px;
  font-size: 12px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .floating-bar,
  .hero-actions,
  .loading-overlay,
  .toast-container,
  .bg {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border-color: rgba(15, 23, 42, 0.2);
  }
}

@media (max-width: 1200px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .grid.three {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 16px 6vw;
  }

  .hero-title h1 {
    font-size: 28px;
  }

  .chart {
    height: 220px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}
