/* === Three Panel Layout === */
.course-shell {
  min-height: calc(100vh - var(--icp-footer-height, 38px));
}

#left-panel {
  width: 260px;
  min-width: 200px;
  overflow-y: auto;
  flex-shrink: 0;
}

#right-panel {
  width: 340px;
  min-width: 280px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* === Typography === */
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

.site-icp-footer {
  --icp-footer-height: 38px;
  min-height: var(--icp-footer-height);
  padding: 0.55rem 1rem;
  text-align: center;
  color: #0d6efd;
  font-size: 1rem;
  line-height: 1.35;
  background: #e9ecef;
  border-top: 1px solid #ced4da;
}

.site-icp-footer a {
  color: inherit;
  text-decoration: none;
}

.site-icp-footer a:hover,
.site-icp-footer a:focus {
  color: #0a58ca;
  text-decoration: underline;
}

/* === Student RPG Dashboard === */
.student-rpg-panel {
  --rpg-ink: #223047;
  --rpg-muted: #64748b;
  --rpg-line: rgba(148, 163, 184, 0.34);
  --rpg-surface: rgba(255, 255, 255, 0.86);
  overflow: hidden;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background:
    radial-gradient(circle at 52% 36%, rgba(248, 213, 117, 0.42), transparent 22%),
    linear-gradient(135deg, #f7fafc 0%, #edf5f1 45%, #f8f2e7 100%);
  color: var(--rpg-ink);
  box-shadow: 0 16px 34px rgba(31, 41, 55, 0.10);
}

.student-rpg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(34, 48, 71, 0.88);
  color: #fff;
}

.student-rpg-kicker {
  font-size: 0.74rem;
  color: #f6d884;
  letter-spacing: 0.12em;
}

.student-rpg-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
}

.student-rpg-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.student-rpg-guide {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background:
    radial-gradient(circle at 52% 24%, rgba(248, 213, 117, 0.24), transparent 24%),
    linear-gradient(135deg, #f7fafc 0%, #edf5f1 52%, #f8f2e7 100%);
}

.rpg-guide-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.rpg-guide-summary strong {
  flex: 0 0 auto;
  color: #92400e;
  font-size: 0.92rem;
}

.rpg-guide-summary span {
  color: var(--rpg-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.rpg-level-road {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.weekly-ai-coach {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 18%, rgba(20, 184, 166, 0.16), transparent 24%),
    linear-gradient(135deg, #f8fafc 0%, #eef7f4 54%, #fff7e6 100%);
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.08);
}

.weekly-ai-main,
.weekly-ai-side {
  min-width: 0;
}

.weekly-ai-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.weekly-ai-heading h5 {
  color: #223047;
  font-weight: 800;
}

.weekly-ai-period {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.76rem;
}

.weekly-ai-empathy {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.7;
}

.weekly-ai-question {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.72rem 0.82rem;
  border-left: 3px solid #0f766e;
  border-radius: 0 8px 8px 0;
  background: rgba(240, 253, 250, 0.88);
  color: #134e4a;
}

.weekly-ai-question span,
.weekly-ai-summary span {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

.weekly-ai-question strong {
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.weekly-ai-side {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.weekly-ai-summary strong {
  display: block;
  color: #223047;
  font-size: 0.92rem;
  line-height: 1.35;
}

.weekly-ai-evidence {
  display: grid;
  gap: 0.5rem;
}

.weekly-ai-evidence-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.45rem;
  min-width: 0;
}

.weekly-ai-evidence-item small {
  grid-column: 2;
  overflow: hidden;
  color: #64748b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-ai-action {
  justify-self: start;
}

.weekly-ai-action-text {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.rpg-level-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 30px;
  padding: 0.28rem 0.52rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
}

.rpg-level-chip b {
  color: #64748b;
}

.rpg-level-chip.completed {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(240, 253, 244, 0.82);
  color: #15803d;
}

.rpg-level-chip.completed b {
  color: #16a34a;
}

.rpg-level-chip.active {
  border-color: rgba(14, 165, 233, 0.46);
  background: #0ea5e9;
  color: #fff;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.22);
}

.rpg-level-chip.active b {
  color: #fff;
}

.project-expedition-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 30%, rgba(59, 130, 246, 0.16), transparent 24%),
    linear-gradient(135deg, #f8fafc, #eff6ff 56%, #f0fdfa);
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.08);
}

.project-summary-copy p {
  color: var(--rpg-muted);
  font-size: 0.86rem;
}

.project-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 0.5rem;
}

.project-summary-metrics div {
  min-width: 76px;
  padding: 0.52rem 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.project-summary-metrics strong {
  display: block;
  color: #0f766e;
  font-size: 1.05rem;
}

.project-summary-metrics span {
  color: #64748b;
  font-size: 0.72rem;
}

.student-rpg-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(220px, 0.85fr) minmax(290px, 1.2fr);
  gap: 1rem;
  padding: 1rem;
}

.student-equipment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-content: start;
}

.equipment-slot {
  min-height: 84px;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--rpg-line);
  border-radius: 8px;
  background: var(--rpg-surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.equipment-slot:hover,
.equipment-slot:focus,
.rpg-skill-card:hover,
.rpg-skill-card:focus,
.rpg-equipment-card:hover,
.rpg-equipment-card:focus {
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.13);
  outline: 0;
  transform: translateY(-1px);
}

.equipment-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #334155;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

.equipment-primary .equipment-icon { background: #2563eb; }
.equipment-success .equipment-icon { background: #16a34a; }
.equipment-warning .equipment-icon { background: #d97706; }
.equipment-danger .equipment-icon { background: #dc2626; }
.equipment-info .equipment-icon { background: #0891b2; }

.equipment-meta {
  min-width: 0;
}

.equipment-slot-name,
.equipment-state,
.rpg-skill-desc {
  color: var(--rpg-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.equipment-name,
.skill-name {
  overflow: hidden;
  color: var(--rpg-ink);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-state {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.student-avatar-stage {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--rpg-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.75)),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.36) 54%, transparent 55%);
}

.avatar-aura {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 174, 0.8), rgba(255, 255, 255, 0.12) 67%);
  box-shadow: 0 0 34px rgba(245, 158, 11, 0.22);
}

.student-avatar {
  position: relative;
  width: min(58%, 240px);
  height: 272px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform: translateY(-22px);
}

.student-avatar.avatar-lv8,
.student-avatar.avatar-lv9,
.student-avatar.avatar-lv10 {
  width: min(68%, 270px);
  height: 292px;
}

.student-avatar-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 18px rgba(15, 23, 42, 0.18));
}

.student-avatar::before,
.student-avatar::after {
  content: "";
  position: absolute;
  display: none;
}

.avatar-head {
  position: absolute;
  left: 38px;
  top: 16px;
  width: 38px;
  height: 44px;
  border-radius: 45% 45% 48% 48%;
  background: linear-gradient(#f7c9a7, #e9a985);
  box-shadow: 0 -10px 0 6px #253247;
}

.avatar-girl .avatar-head {
  border-radius: 47% 47% 50% 50%;
  box-shadow:
    0 -12px 0 7px #172554,
    -10px 2px 0 2px #172554,
    10px 2px 0 2px #172554;
}

.avatar-girl::before {
  display: block;
  left: 31px;
  top: 21px;
  width: 52px;
  height: 58px;
  z-index: 0;
  border-radius: 40% 40% 50% 50%;
  background: #172554;
}

.avatar-body {
  position: absolute;
  left: 32px;
  top: 64px;
  width: 50px;
  height: 92px;
  border-radius: 24px 24px 14px 14px;
  background: linear-gradient(145deg, #f7fafc 0%, #e2e8f0 45%, #334155 46%, #111827 100%);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.18);
}

.avatar-girl .avatar-body {
  left: 30px;
  width: 54px;
  border-radius: 24px 24px 20px 20px;
}

.avatar-sash {
  position: absolute;
  left: 4px;
  top: 18px;
  width: 46px;
  height: 13px;
  transform: rotate(-25deg);
  border-radius: 999px;
  background: #d97706;
}

.avatar-arm,
.avatar-leg,
.avatar-cape,
.avatar-tool {
  position: absolute;
  background: #1f2937;
}

.avatar-arm {
  top: 74px;
  width: 15px;
  height: 76px;
  border-radius: 999px;
}

.avatar-arm-left {
  left: 21px;
  transform: rotate(13deg);
}

.avatar-arm-right {
  right: 21px;
  transform: rotate(-13deg);
}

.avatar-leg {
  top: 150px;
  width: 18px;
  height: 76px;
  border-radius: 999px;
  background: linear-gradient(#334155, #e2e8f0);
}

.avatar-leg-left {
  left: 36px;
  transform: rotate(7deg);
}

.avatar-leg-right {
  right: 34px;
  transform: rotate(-7deg);
}

.avatar-girl .avatar-leg {
  width: 16px;
}

.avatar-girl .avatar-leg-left {
  left: 39px;
}

.avatar-girl .avatar-leg-right {
  right: 37px;
}

.avatar-cape {
  left: 18px;
  top: 60px;
  width: 76px;
  height: 138px;
  z-index: -1;
  border-radius: 50% 50% 14px 14px;
  transform: skewX(-9deg);
  background: linear-gradient(160deg, rgba(71, 85, 105, 0.9), rgba(15, 23, 42, 0.94));
}

.avatar-tool {
  display: none;
  z-index: 2;
}

.avatar-lv1 .avatar-head {
  border-radius: 48% 48% 45% 45%;
  box-shadow: 0 -7px 0 5px #334155;
}

.avatar-girl.avatar-lv1 .avatar-head {
  box-shadow: 0 -9px 0 6px #334155, -8px 3px 0 1px #334155, 8px 3px 0 1px #334155;
}

.avatar-girl.avatar-lv1::before {
  background: #334155;
}

.avatar-lv1 .avatar-body {
  background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 50%, #475569 51%, #334155 100%);
}

.avatar-lv1 .avatar-cape,
.avatar-lv1 .avatar-tool {
  display: none;
}

.avatar-lv2 .avatar-head {
  box-shadow: -6px -11px 0 5px #253247, 6px -7px 0 3px #253247;
}

.avatar-girl.avatar-lv2 .avatar-head {
  box-shadow: 0 -11px 0 7px #1e3a8a, -11px 2px 0 2px #1e3a8a, 10px 0 0 1px #1e3a8a;
}

.avatar-girl.avatar-lv2::before {
  background: #1e3a8a;
}

.avatar-lv2 .avatar-body {
  border-radius: 18px 26px 14px 14px;
  background: linear-gradient(145deg, #eef6ff 0%, #bfdbfe 42%, #2563eb 43%, #1e3a8a 100%);
}

.avatar-girl.avatar-lv2 .avatar-body {
  border-radius: 22px 24px 18px 18px;
  background: linear-gradient(145deg, #eef6ff 0%, #bfdbfe 38%, #2563eb 39%, #1e3a8a 100%);
}

.avatar-lv2 .avatar-sash {
  background: #0ea5e9;
}

.avatar-lv2 .avatar-cape {
  width: 58px;
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.78), rgba(30, 58, 138, 0.88));
}

.student-avatar.avatar-lv3 + .avatar-nameplate {
  border-color: rgba(14, 165, 233, 0.22);
}

.student-avatar-stage:has(.avatar-lv2) .avatar-aura {
  background: radial-gradient(circle, rgba(191, 219, 254, 0.8), rgba(255, 255, 255, 0.12) 67%);
}

.student-avatar-stage:has(.avatar-lv3) .avatar-aura {
  background: radial-gradient(circle, rgba(187, 247, 208, 0.82), rgba(255, 255, 255, 0.12) 67%);
}

.student-avatar-stage:has(.avatar-lv4) .avatar-aura {
  background: radial-gradient(circle, rgba(254, 215, 170, 0.86), rgba(255, 255, 255, 0.12) 67%);
}

.student-avatar-stage:has(.avatar-lv5) .avatar-aura {
  background: radial-gradient(circle, rgba(221, 214, 254, 0.88), rgba(255, 255, 255, 0.12) 67%);
  box-shadow: 0 0 42px rgba(124, 58, 237, 0.24);
}

.student-avatar-stage:has(.avatar-lv6) .avatar-aura,
.student-avatar-stage:has(.avatar-lv7) .avatar-aura {
  background: radial-gradient(circle, rgba(167, 243, 208, 0.9), rgba(255, 255, 255, 0.12) 67%);
  box-shadow: 0 0 42px rgba(16, 185, 129, 0.24);
}

.student-avatar-stage:has(.avatar-lv8) .avatar-aura {
  background: radial-gradient(circle, rgba(254, 215, 170, 0.9), rgba(255, 255, 255, 0.12) 67%);
  box-shadow: 0 0 42px rgba(249, 115, 22, 0.24);
}

.student-avatar-stage:has(.avatar-lv9) .avatar-aura,
.student-avatar-stage:has(.avatar-lv10) .avatar-aura {
  background: radial-gradient(circle, rgba(165, 243, 252, 0.9), rgba(255, 255, 255, 0.12) 67%);
  box-shadow: 0 0 48px rgba(6, 182, 212, 0.28);
}

.avatar-lv3 .avatar-head {
  box-shadow: 0 -12px 0 7px #0f172a, -11px -4px 0 -1px #0f172a;
}

.avatar-girl.avatar-lv3 .avatar-head {
  box-shadow: 0 -12px 0 7px #064e3b, -12px 2px 0 2px #064e3b, 11px 1px 0 1px #064e3b;
}

.avatar-girl.avatar-lv3::before {
  background: #064e3b;
}

.avatar-lv3 .avatar-body {
  width: 54px;
  background: linear-gradient(145deg, #f0fdf4 0%, #bbf7d0 38%, #16a34a 39%, #14532d 100%);
}

.avatar-girl.avatar-lv3 .avatar-body {
  width: 56px;
  background: linear-gradient(145deg, #ecfdf5 0%, #99f6e4 34%, #0d9488 35%, #134e4a 100%);
}

.avatar-lv3 .avatar-sash {
  height: 16px;
  background: #f59e0b;
}

.avatar-lv3 .avatar-cape {
  left: 15px;
  width: 84px;
  background: linear-gradient(160deg, rgba(22, 163, 74, 0.82), rgba(20, 83, 45, 0.92));
}

.avatar-lv3 .avatar-tool {
  display: block;
  right: 8px;
  top: 82px;
  width: 9px;
  height: 88px;
  border-radius: 999px;
  transform: rotate(-12deg);
  background: linear-gradient(#f8fafc, #64748b);
}

.avatar-lv4 .avatar-head {
  box-shadow: 0 -13px 0 8px #172554, 12px -7px 0 1px #172554;
}

.avatar-girl.avatar-lv4 .avatar-head {
  box-shadow: 0 -13px 0 8px #7f1d1d, -12px 2px 0 2px #7f1d1d, 12px 0 0 2px #7f1d1d;
}

.avatar-girl.avatar-lv4::before {
  background: #7f1d1d;
}

.avatar-lv4 .avatar-body {
  left: 29px;
  width: 58px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(145deg, #fff7ed 0%, #fed7aa 34%, #dc2626 35%, #7f1d1d 100%);
}

.avatar-girl.avatar-lv4 .avatar-body {
  left: 28px;
  width: 58px;
  background: linear-gradient(145deg, #fff7ed 0%, #fecaca 32%, #dc2626 33%, #7f1d1d 100%);
}

.avatar-lv4 .avatar-sash {
  width: 56px;
  height: 15px;
  background: #facc15;
}

.avatar-lv4 .avatar-cape {
  left: 10px;
  top: 56px;
  width: 92px;
  height: 148px;
  background: linear-gradient(160deg, rgba(220, 38, 38, 0.82), rgba(69, 10, 10, 0.95));
}

.avatar-lv4 .avatar-tool {
  display: block;
  right: 3px;
  top: 71px;
  width: 12px;
  height: 104px;
  border-radius: 999px 999px 5px 5px;
  transform: rotate(-18deg);
  background: linear-gradient(#fde68a 0 16%, #475569 17% 100%);
}

.avatar-lv5 .avatar-head {
  box-shadow: 0 -12px 0 7px #111827, -10px -8px 0 2px #111827, 10px -8px 0 2px #111827;
}

.avatar-girl.avatar-lv5 .avatar-head {
  box-shadow: 0 -13px 0 8px #0f172a, -13px 2px 0 2px #0f172a, 13px 1px 0 2px #0f172a;
}

.avatar-girl.avatar-lv5::before {
  background: #0f172a;
}

.avatar-lv5 .avatar-body {
  left: 27px;
  width: 60px;
  background: linear-gradient(145deg, #fdf2f8 0%, #fbcfe8 30%, #7c3aed 31%, #312e81 100%);
}

.avatar-girl.avatar-lv5 .avatar-body {
  background: linear-gradient(145deg, #ecfeff 0%, #a5f3fc 28%, #0891b2 29%, #164e63 100%);
}

.avatar-lv5 .avatar-sash {
  width: 62px;
  height: 16px;
  background: linear-gradient(90deg, #f59e0b, #fef08a, #22d3ee);
}

.avatar-lv5 .avatar-cape {
  left: 5px;
  top: 52px;
  width: 102px;
  height: 156px;
  border-radius: 46% 46% 12px 12px;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.86), rgba(17, 24, 39, 0.96));
}

.avatar-lv5 .avatar-tool {
  display: block;
  right: -2px;
  top: 66px;
  width: 13px;
  height: 116px;
  border-radius: 999px;
  transform: rotate(-20deg);
  background: linear-gradient(#fef3c7 0 14%, #38bdf8 15% 28%, #334155 29% 100%);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.36);
}

.avatar-lv6 .avatar-head {
  box-shadow: 0 -12px 0 7px #064e3b, -12px -5px 0 1px #064e3b;
}

.avatar-girl.avatar-lv6 .avatar-head {
  box-shadow: 0 -13px 0 8px #064e3b, -13px 2px 0 2px #064e3b, 13px 1px 0 2px #064e3b;
}

.avatar-girl.avatar-lv6::before {
  background: #064e3b;
}

.avatar-lv6 .avatar-body {
  left: 28px;
  width: 58px;
  background: linear-gradient(145deg, #ecfdf5 0%, #a7f3d0 32%, #059669 33%, #064e3b 100%);
}

.avatar-girl.avatar-lv6 .avatar-body {
  width: 60px;
  background: linear-gradient(145deg, #f0fdfa 0%, #99f6e4 28%, #047857 29%, #064e3b 100%);
}

.avatar-lv6 .avatar-sash {
  width: 60px;
  height: 15px;
  background: #38bdf8;
}

.avatar-lv6 .avatar-cape {
  left: 8px;
  top: 54px;
  width: 96px;
  height: 152px;
  background: linear-gradient(160deg, rgba(5, 150, 105, 0.86), rgba(6, 78, 59, 0.96));
}

.avatar-lv6 .avatar-tool,
.avatar-lv7 .avatar-tool,
.avatar-lv8 .avatar-tool,
.avatar-lv9 .avatar-tool,
.avatar-lv10 .avatar-tool {
  display: block;
  right: -2px;
  top: 66px;
  width: 13px;
  height: 116px;
  border-radius: 999px;
  transform: rotate(-20deg);
}

.avatar-lv6 .avatar-tool {
  background: linear-gradient(#d1fae5 0 18%, #0f766e 19% 100%);
}

.avatar-lv7 .avatar-head {
  box-shadow: 0 -12px 0 7px #1e293b, 12px -7px 0 1px #1e293b;
}

.avatar-girl.avatar-lv7 .avatar-head {
  box-shadow: 0 -13px 0 8px #1e293b, -13px 2px 0 2px #1e293b, 13px 1px 0 2px #1e293b;
}

.avatar-girl.avatar-lv7::before {
  background: #1e293b;
}

.avatar-lv7 .avatar-body {
  left: 27px;
  width: 60px;
  background: linear-gradient(145deg, #f8fafc 0%, #cbd5e1 30%, #475569 31%, #111827 100%);
}

.avatar-girl.avatar-lv7 .avatar-body {
  width: 62px;
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 26%, #475569 27%, #111827 100%);
}

.avatar-lv7 .avatar-sash {
  width: 62px;
  height: 15px;
  background: #f59e0b;
}

.avatar-lv7 .avatar-cape {
  left: 6px;
  top: 52px;
  width: 100px;
  height: 156px;
  background: linear-gradient(160deg, rgba(71, 85, 105, 0.88), rgba(15, 23, 42, 0.97));
}

.avatar-lv7 .avatar-tool {
  background: linear-gradient(#fde68a 0 14%, #64748b 15% 100%);
}

.avatar-lv8 .avatar-head {
  box-shadow: 0 -13px 0 8px #7c2d12, -10px -7px 0 1px #7c2d12;
}

.avatar-girl.avatar-lv8 .avatar-head {
  box-shadow: 0 -13px 0 8px #7c2d12, -13px 2px 0 2px #7c2d12, 13px 1px 0 2px #7c2d12;
}

.avatar-girl.avatar-lv8::before {
  background: #7c2d12;
}

.avatar-lv8 .avatar-body {
  left: 26px;
  width: 62px;
  background: linear-gradient(145deg, #fff7ed 0%, #fed7aa 28%, #2563eb 29%, #1e3a8a 100%);
}

.avatar-girl.avatar-lv8 .avatar-body {
  width: 64px;
  background: linear-gradient(145deg, #fff7ed 0%, #fed7aa 25%, #2563eb 26%, #1e3a8a 100%);
}

.avatar-lv8 .avatar-sash {
  width: 64px;
  height: 16px;
  background: #fb923c;
}

.avatar-lv8 .avatar-cape {
  left: 4px;
  top: 50px;
  width: 104px;
  height: 160px;
  background: linear-gradient(160deg, rgba(251, 146, 60, 0.88), rgba(30, 64, 175, 0.95));
}

.avatar-lv8 .avatar-tool {
  background: linear-gradient(#fed7aa 0 16%, #2563eb 17% 100%);
}

.avatar-lv9 .avatar-head {
  box-shadow: 0 -12px 0 8px #020617, -12px -8px 0 2px #020617, 12px -8px 0 2px #020617;
}

.avatar-girl.avatar-lv9 .avatar-head {
  box-shadow: 0 -13px 0 8px #020617, -14px 2px 0 3px #020617, 14px 1px 0 3px #020617;
}

.avatar-girl.avatar-lv9::before {
  background: #020617;
}

.avatar-lv9 .avatar-body {
  left: 25px;
  width: 64px;
  background: linear-gradient(145deg, #ecfeff 0%, #67e8f9 24%, #1e293b 25%, #020617 100%);
}

.avatar-girl.avatar-lv9 .avatar-body {
  width: 66px;
  background: linear-gradient(145deg, #ecfeff 0%, #67e8f9 22%, #1e293b 23%, #020617 100%);
}

.avatar-lv9 .avatar-sash {
  width: 66px;
  height: 16px;
  background: linear-gradient(90deg, #f59e0b, #22d3ee);
}

.avatar-lv9 .avatar-cape {
  left: 2px;
  top: 48px;
  width: 108px;
  height: 164px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(8, 47, 73, 0.98));
}

.avatar-lv9 .avatar-tool {
  background: linear-gradient(#fef3c7 0 14%, #22d3ee 15% 28%, #0f172a 29% 100%);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.34);
}

.avatar-lv10 .avatar-head {
  box-shadow: 0 -12px 0 8px #111827, -13px -8px 0 3px #111827, 13px -8px 0 3px #111827;
}

.avatar-girl.avatar-lv10 .avatar-head {
  box-shadow: 0 -13px 0 8px #111827, -15px 2px 0 3px #111827, 15px 1px 0 3px #111827;
}

.avatar-girl.avatar-lv10::before {
  background: #111827;
}

.avatar-lv10 .avatar-body {
  left: 23px;
  width: 68px;
  background: linear-gradient(145deg, #fefce8 0%, #fef08a 20%, #06b6d4 21%, #312e81 100%);
}

.avatar-girl.avatar-lv10 .avatar-body {
  width: 70px;
  background: linear-gradient(145deg, #fefce8 0%, #fef08a 18%, #06b6d4 19%, #312e81 100%);
}

.avatar-lv10 .avatar-sash {
  width: 70px;
  height: 17px;
  background: linear-gradient(90deg, #f59e0b, #fef08a, #67e8f9);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.34);
}

.avatar-lv10 .avatar-cape {
  left: -2px;
  top: 46px;
  width: 116px;
  height: 170px;
  border-radius: 46% 46% 10px 10px;
  background: linear-gradient(160deg, rgba(6, 182, 212, 0.88), rgba(49, 46, 129, 0.98));
}

.avatar-lv10 .avatar-tool {
  background: linear-gradient(#fef3c7 0 12%, #facc15 13% 22%, #22d3ee 23% 38%, #111827 39% 100%);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.38);
}

.avatar-nameplate,
.avatar-power {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10);
}

.avatar-nameplate {
  bottom: 54px;
  max-width: calc(100% - 28px);
  padding: 0.4rem 0.65rem;
  font-size: 0.83rem;
}

.avatar-nameplate span:last-child {
  color: var(--rpg-muted);
  font-size: 0.75rem;
}

.avatar-power {
  bottom: 16px;
  padding: 0.32rem 0.8rem;
  color: #9a3412;
  font-weight: 800;
}

.student-stat-panel {
  padding: 0.85rem;
  border: 1px solid var(--rpg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.student-rpg-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.student-rpg-tabs button {
  flex: 1;
  padding: 0.45rem 0.4rem;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  color: var(--rpg-muted);
  background: #f8fafc;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.student-rpg-tabs button:hover,
.student-rpg-tabs button:focus {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.student-rpg-tabs .active {
  color: #7c2d12;
  border-color: #f7c948;
  background: #fff7d6;
}

.student-rpg-statement {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  background: #fffbeb;
  color: #713f12;
  font-size: 0.86rem;
  line-height: 1.55;
}

.rpg-stat-row {
  margin-bottom: 0.65rem;
}

.rpg-stat-row em {
  margin-left: 0.35rem;
  color: var(--rpg-muted);
  font-style: normal;
  font-size: 0.72rem;
}

.rpg-meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
}

.rpg-meter-thin {
  height: 6px;
}

.rpg-meter-fill {
  height: 100%;
  border-radius: inherit;
}

.rpg-core-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.85rem 0;
}

.rpg-core-metrics div {
  padding: 0.55rem 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  text-align: center;
}

.rpg-core-metrics strong {
  display: block;
  font-size: 1.15rem;
  color: #0f766e;
  line-height: 1.15;
}

.rpg-core-metrics span {
  color: var(--rpg-muted);
  font-size: 0.72rem;
}

.rpg-skill-deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.rpg-equipment-deck {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.rpg-skill-card,
.rpg-equipment-card {
  min-width: 0;
  padding: 0.6rem;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.rpg-equipment-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.rpg-skill-desc {
  min-height: 1.8em;
  margin: 0.35rem 0;
}

@media (max-width: 991.98px) {
  .student-rpg-grid {
    grid-template-columns: 1fr;
  }

  .student-avatar-stage {
    min-height: 320px;
    order: -1;
  }

  .weekly-ai-coach {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .student-rpg-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .rpg-guide-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .student-rpg-actions {
    width: 100%;
    justify-content: stretch;
  }

  .student-rpg-actions .btn {
    flex: 1;
  }

  .student-equipment-grid,
  .rpg-skill-deck {
    grid-template-columns: 1fr;
  }

  .rpg-core-metrics {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .weekly-ai-heading,
  .weekly-ai-question {
    grid-template-columns: 1fr;
  }

  .weekly-ai-heading {
    flex-direction: column;
    gap: 0.35rem;
  }

  .weekly-ai-period {
    align-self: flex-start;
  }
}

/* === Quiz Adventure Map === */
.quiz-adventure-map,
.quiz-challenge-board {
  overflow: hidden;
  border: 1px solid #cfe0d5;
  border-radius: 8px;
  background: #f8fcf7;
  box-shadow: 0 14px 30px rgba(31, 41, 55, 0.10);
}

.quiz-map-topbar,
.quiz-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, #164e63, #166534);
  color: #fff;
}

.quiz-map-kicker {
  color: #d9f99d;
  font-size: 0.72rem;
  font-weight: 700;
}

.quiz-map-title {
  color: #fff;
  font-weight: 800;
}

.quiz-map-rule {
  padding: 0.32rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  white-space: nowrap;
}

.quiz-map-scene {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 76%, rgba(187, 247, 208, 0.9) 0 9%, transparent 10%),
    radial-gradient(circle at 78% 66%, rgba(134, 239, 172, 0.82) 0 14%, transparent 15%),
    linear-gradient(180deg, #48b9e7 0 28%, #8bdc78 29% 100%);
}

.quiz-map-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 42%;
  background:
    radial-gradient(circle at 12% 32%, rgba(255, 255, 255, 0.82) 0 4%, transparent 5%),
    radial-gradient(circle at 88% 25%, rgba(255, 255, 255, 0.7) 0 5%, transparent 6%),
    linear-gradient(180deg, rgba(125, 211, 252, 0.64), rgba(255, 255, 255, 0.18));
}

.quiz-map-mountain {
  position: absolute;
  top: 34px;
  width: 210px;
  height: 190px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(255, 255, 255, 0.88) 39% 52%, transparent 53%),
    linear-gradient(145deg, #dcfce7 0 18%, #22c55e 19% 64%, #15803d 65% 100%);
  opacity: 0.96;
}

.quiz-map-mountain-left {
  left: 6%;
}

.quiz-map-mountain-mid {
  left: 38%;
  top: 12px;
  transform: scale(1.08);
}

.quiz-map-mountain-right {
  right: 5%;
}

.quiz-map-river {
  position: absolute;
  left: -7%;
  top: 34%;
  width: 50%;
  height: 72%;
  border-radius: 45% 55% 50% 50%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, #0ea5e9, #7dd3fc 45%, #0284c7);
  box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.24);
}

.quiz-map-path {
  position: absolute;
  left: 11%;
  top: 64%;
  width: 78%;
  height: 26%;
  border-top: 22px dotted #e8c98a;
  border-radius: 50%;
  transform: rotate(-8deg);
  opacity: 0.94;
}

.quiz-map-node {
  position: absolute;
  z-index: 3;
  width: 146px;
  color: #172033;
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.quiz-map-player {
  position: absolute;
  z-index: 4;
  width: 92px;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  color: #172033;
  text-align: center;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.quiz-map-player::after {
  content: "";
  width: 34px;
  height: 10px;
  margin-top: -10px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.18);
  filter: blur(2px);
}

.quiz-map-player img {
  display: block;
  max-width: 90px;
  max-height: 150px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 12px rgba(15, 23, 42, 0.25));
}

.quiz-map-player span {
  max-width: 116px;
  padding: 0.22rem 0.48rem;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

.quiz-map-player span b {
  margin-right: 0.16rem;
  color: #fde68a;
}

.quiz-node-building {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 58px;
  display: flex;
  align-items: end;
  justify-content: center;
  margin: 0 auto 0.35rem;
  padding-bottom: 0.35rem;
  border: 3px solid rgba(120, 53, 15, 0.46);
  border-radius: 8px 8px 12px 12px;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, 0.38) 49% 55%, transparent 56%),
    linear-gradient(180deg, #fef3c7, #fbbf24);
  color: #7c2d12;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(69, 26, 3, 0.18);
}

.quiz-node-building::before {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  top: -21px;
  height: 30px;
  border-radius: 18px 18px 5px 5px;
  background: repeating-linear-gradient(90deg, #f97316 0 10px, #ea580c 11px 20px);
  transform: skewX(-12deg);
}

.quiz-map-node-river .quiz-node-building {
  background: linear-gradient(180deg, #cffafe, #38bdf8);
}

.quiz-map-node-field .quiz-node-building {
  background: linear-gradient(180deg, #dcfce7, #22c55e);
}

.quiz-map-node-village .quiz-node-building {
  background: linear-gradient(180deg, #ffedd5, #fb923c);
}

.quiz-map-node-mountain .quiz-node-building,
.quiz-map-node-snow .quiz-node-building {
  background: linear-gradient(180deg, #f8fafc, #94a3b8);
}

.quiz-map-node-tower .quiz-node-building {
  background: linear-gradient(180deg, #ede9fe, #8b5cf6);
}

.quiz-node-pin {
  position: absolute;
  left: 50%;
  top: -12px;
  z-index: 4;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  transform: translateX(8px);
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.22);
}

.quiz-node-card {
  display: block;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(3px);
}

.quiz-node-card strong,
.quiz-dock-main strong {
  display: block;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-node-card span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
}

.quiz-node-card em {
  color: #0f766e;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.quiz-node-progress {
  overflow: hidden;
  height: 6px;
  margin: 0.35rem 0 0.25rem;
  border-radius: 999px;
  background: #dbeafe;
}

.quiz-node-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #16a34a;
}

.quiz-map-node-secondary .quiz-node-progress i,
.quiz-map-node-secondary .quiz-node-pin {
  background: #64748b;
}

.quiz-map-node-warning .quiz-node-progress i,
.quiz-map-node-warning .quiz-node-pin {
  background: #f59e0b;
}

.quiz-map-node-primary .quiz-node-progress i,
.quiz-map-node-primary .quiz-node-pin {
  background: #2563eb;
}

.quiz-map-node-success .quiz-node-progress i,
.quiz-map-node-success .quiz-node-pin {
  background: #16a34a;
}

.quiz-map-node:hover,
.quiz-map-node:focus {
  z-index: 5;
  color: #172033;
  outline: 0;
}

.quiz-map-node:hover .quiz-node-building,
.quiz-map-node:focus .quiz-node-building,
.quiz-map-node.is-current .quiz-node-building {
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.42), 0 14px 24px rgba(69, 26, 3, 0.22);
}

.quiz-map-dock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  padding: 0.85rem;
  background: #f8fcf7;
}

.quiz-game-guide {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid #d9e7dc;
  background: linear-gradient(90deg, #f0fdf4, #f8fcf7);
  color: #475569;
  font-size: 0.82rem;
}

.quiz-game-guide strong {
  color: #166534;
  font-size: 0.9rem;
}

.quiz-game-guide span {
  position: relative;
}

.quiz-game-guide span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 0.72rem;
  border-radius: 50%;
  background: #86efac;
  vertical-align: middle;
}

.quiz-dock-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid #d9e7dc;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-decoration: none;
}

.quiz-dock-card:hover,
.quiz-dock-card:focus,
.quiz-dock-card.is-current {
  border-color: #22c55e;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.14);
  outline: 0;
}

.quiz-dock-index,
.quiz-level-badge {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #166534;
  color: #fff;
  font-weight: 800;
}

.quiz-dock-main {
  min-width: 0;
  flex: 1;
}

.quiz-dock-main small {
  display: block;
  color: #64748b;
}

.quiz-challenge-board {
  padding: 0 1rem 1rem;
}

.quiz-board-header {
  margin: 0 -1rem 1rem;
}

.quiz-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.quiz-filter-bar select {
  min-width: 160px;
}

.quiz-level-list {
  display: grid;
  gap: 0.6rem;
}

.quiz-level-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-decoration: none;
}

.quiz-level-card:hover,
.quiz-level-card:focus {
  border-color: #60a5fa;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
  outline: 0;
}

.quiz-level-clear .quiz-level-badge {
  background: #16a34a;
}

.quiz-level-revive .quiz-level-badge {
  background: #f59e0b;
}

.quiz-level-new .quiz-level-badge {
  background: #64748b;
}

.quiz-level-main {
  min-width: 0;
  flex: 1;
}

.quiz-level-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-level-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.28rem;
  color: #64748b;
  font-size: 0.78rem;
}

.quiz-kp-chip {
  padding: 0.08rem 0.34rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
}

.quiz-level-status {
  flex: 0 0 auto;
}

@media (max-width: 767.98px) {
  .quiz-map-topbar,
  .quiz-board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quiz-map-rule {
    white-space: normal;
  }

  .quiz-map-scene {
    min-height: 520px;
  }

  .quiz-map-node {
    width: 132px;
  }

  .quiz-level-card {
    align-items: flex-start;
  }

  .quiz-level-title {
    white-space: normal;
  }
}

@media (max-width: 575.98px) {
  .quiz-map-dock {
    grid-template-columns: 1fr;
  }

  .quiz-filter-bar > div,
  .quiz-filter-bar select,
  .quiz-filter-bar button {
    width: 100%;
  }

  .quiz-level-status {
    display: none;
  }
}

/* === Discussion Adventure Map === */
.discussion-adventure-map,
.discussion-challenge-board {
  overflow: hidden;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #fbfcf8;
  box-shadow: 0 14px 30px rgba(31, 41, 55, 0.10);
}

.discussion-map-topbar,
.discussion-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, #334155, #0f766e);
  color: #fff;
}

.discussion-map-kicker {
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 700;
}

.discussion-map-title {
  color: #fff;
  font-weight: 800;
}

.discussion-map-rule {
  padding: 0.32rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  white-space: nowrap;
}

.discussion-map-scene {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 72%, rgba(253, 230, 138, 0.52) 0 8%, transparent 9%),
    radial-gradient(circle at 74% 66%, rgba(153, 246, 228, 0.74) 0 14%, transparent 15%),
    linear-gradient(180deg, #7dd3fc 0 30%, #a7f3d0 31% 100%);
}

.discussion-map-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 40%;
  background:
    radial-gradient(circle at 14% 32%, rgba(255, 255, 255, 0.82) 0 4%, transparent 5%),
    radial-gradient(circle at 86% 26%, rgba(255, 255, 255, 0.72) 0 5%, transparent 6%),
    linear-gradient(180deg, rgba(186, 230, 253, 0.62), rgba(255, 255, 255, 0.18));
}

.discussion-map-hill {
  position: absolute;
  bottom: 25%;
  width: 260px;
  height: 150px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(145deg, #bbf7d0, #22c55e 62%, #15803d);
  opacity: 0.92;
}

.discussion-map-hill-left {
  left: 4%;
  transform: scale(0.82);
}

.discussion-map-hill-mid {
  left: 38%;
  bottom: 31%;
  transform: scale(1.06);
}

.discussion-map-hill-right {
  right: 6%;
  transform: scale(0.9);
}

.discussion-map-lake {
  position: absolute;
  left: -7%;
  top: 38%;
  width: 38%;
  height: 58%;
  border-radius: 50%;
  background: linear-gradient(90deg, #0ea5e9, #bae6fd 46%, #0284c7);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.24);
}

.discussion-map-path {
  position: absolute;
  left: 10%;
  top: 64%;
  width: 78%;
  height: 26%;
  border-top: 20px dotted #e7c985;
  border-radius: 50%;
  transform: rotate(-8deg);
  opacity: 0.94;
}

.discussion-map-node {
  position: absolute;
  z-index: 3;
  width: 148px;
  color: #172033;
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.discussion-map-player {
  position: absolute;
  z-index: 4;
  width: 92px;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  color: #172033;
  text-align: center;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.discussion-map-player::after {
  content: "";
  width: 34px;
  height: 10px;
  margin-top: -10px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.18);
  filter: blur(2px);
}

.discussion-map-player img {
  display: block;
  max-width: 90px;
  max-height: 150px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 12px rgba(15, 23, 42, 0.25));
}

.discussion-map-player span {
  max-width: 116px;
  padding: 0.22rem 0.48rem;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

.discussion-map-player span b {
  margin-right: 0.16rem;
  color: #fde68a;
}

.discussion-node-building {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 58px;
  display: flex;
  align-items: end;
  justify-content: center;
  margin: 0 auto 0.35rem;
  padding-bottom: 0.35rem;
  border: 3px solid rgba(68, 64, 60, 0.36);
  border-radius: 8px 8px 12px 12px;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, 0.36) 49% 55%, transparent 56%),
    linear-gradient(180deg, #fef3c7, #f59e0b);
  color: #78350f;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(69, 26, 3, 0.18);
}

.discussion-node-building::before {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  top: -20px;
  height: 29px;
  border-radius: 18px 18px 5px 5px;
  background: repeating-linear-gradient(90deg, #0f766e 0 10px, #115e59 11px 20px);
  transform: skewX(-12deg);
}

.discussion-map-node-bridge .discussion-node-building {
  background: linear-gradient(180deg, #e0f2fe, #38bdf8);
}

.discussion-map-node-library .discussion-node-building {
  background: linear-gradient(180deg, #fef3c7, #f97316);
}

.discussion-map-node-plaza .discussion-node-building {
  background: linear-gradient(180deg, #dcfce7, #22c55e);
}

.discussion-map-node-tower .discussion-node-building,
.discussion-map-node-hall .discussion-node-building {
  background: linear-gradient(180deg, #f8fafc, #64748b);
}

.discussion-map-node-dock .discussion-node-building {
  background: linear-gradient(180deg, #cffafe, #0891b2);
}

.discussion-node-pin {
  position: absolute;
  left: 50%;
  top: -12px;
  z-index: 4;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  transform: translateX(8px);
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.22);
}

.discussion-node-card {
  display: block;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(3px);
}

.discussion-node-card strong,
.discussion-dock-main strong {
  display: block;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discussion-node-card span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
}

.discussion-node-card em {
  color: #0f766e;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.discussion-node-progress {
  overflow: hidden;
  height: 6px;
  margin: 0.35rem 0 0.25rem;
  border-radius: 999px;
  background: #dbeafe;
}

.discussion-node-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #14b8a6;
}

.discussion-map-node-secondary .discussion-node-progress i,
.discussion-map-node-secondary .discussion-node-pin {
  background: #64748b;
}

.discussion-map-node-warning .discussion-node-progress i,
.discussion-map-node-warning .discussion-node-pin {
  background: #f59e0b;
}

.discussion-map-node-primary .discussion-node-progress i,
.discussion-map-node-primary .discussion-node-pin {
  background: #2563eb;
}

.discussion-map-node-success .discussion-node-progress i,
.discussion-map-node-success .discussion-node-pin {
  background: #16a34a;
}

.discussion-map-node:hover,
.discussion-map-node:focus {
  z-index: 5;
  color: #172033;
  outline: 0;
}

.discussion-map-node:hover .discussion-node-building,
.discussion-map-node:focus .discussion-node-building {
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.32), 0 14px 24px rgba(69, 26, 3, 0.22);
}

.discussion-map-dock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  padding: 0.85rem;
  background: #fbfcf8;
}

.discussion-dock-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-decoration: none;
}

.discussion-dock-card:hover,
.discussion-dock-card:focus {
  border-color: #14b8a6;
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.14);
  outline: 0;
}

.discussion-dock-index,
.discussion-level-badge {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
}

.discussion-dock-main,
.discussion-level-main {
  min-width: 0;
  flex: 1;
}

.discussion-dock-main small {
  display: block;
  color: #64748b;
}

.discussion-game-guide {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid #dbe5e1;
  background: linear-gradient(90deg, #f0fdfa, #fbfcf8);
  color: #475569;
  font-size: 0.82rem;
}

.discussion-game-guide strong {
  color: #0f766e;
  font-size: 0.9rem;
}

.discussion-game-guide span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 0.72rem;
  border-radius: 50%;
  background: #5eead4;
  vertical-align: middle;
}

.discussion-challenge-board {
  padding: 0 1rem 1rem;
}

.discussion-board-header {
  margin: 0 -1rem 1rem;
}

.discussion-level-list {
  display: grid;
  gap: 0.6rem;
}

.discussion-level-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-decoration: none;
}

.discussion-level-card:hover,
.discussion-level-card:focus {
  border-color: #14b8a6;
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.12);
  outline: 0;
}

.discussion-level-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discussion-level-desc {
  display: -webkit-box;
  overflow: hidden;
  margin: 0.25rem 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.discussion-level-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: #64748b;
  font-size: 0.78rem;
}

.discussion-kp-chip {
  padding: 0.08rem 0.34rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
}

.discussion-level-status {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 0.25rem;
}

.discussion-level-status small {
  color: #64748b;
}

@media (max-width: 767.98px) {
  .discussion-map-topbar,
  .discussion-board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .discussion-map-rule {
    white-space: normal;
  }

  .discussion-map-scene {
    min-height: 520px;
  }

  .discussion-map-node {
    width: 132px;
  }

  .discussion-level-card {
    align-items: flex-start;
  }

  .discussion-level-title {
    white-space: normal;
  }
}

@media (max-width: 575.98px) {
  .discussion-map-dock {
    grid-template-columns: 1fr;
  }

  .discussion-level-status {
    display: none;
  }
}

/* === Project Expedition Map === */
.project-adventure-map,
.project-challenge-board {
  overflow: hidden;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 14px 30px rgba(31, 41, 55, 0.10);
}

.project-map-topbar,
.project-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, #1e3a8a, #0f766e);
  color: #fff;
}

.project-map-kicker {
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-map-title {
  color: #fff;
  font-weight: 800;
}

.project-map-rule {
  padding: 0.32rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  white-space: nowrap;
}

.project-map-scene {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 73%, rgba(191, 219, 254, 0.65) 0 9%, transparent 10%),
    radial-gradient(circle at 76% 66%, rgba(167, 243, 208, 0.76) 0 13%, transparent 14%),
    linear-gradient(180deg, #60a5fa 0 28%, #86efac 29% 100%);
}

.project-map-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 42%;
  background:
    radial-gradient(circle at 13% 30%, rgba(255, 255, 255, 0.82) 0 4%, transparent 5%),
    radial-gradient(circle at 86% 26%, rgba(255, 255, 255, 0.72) 0 5%, transparent 6%),
    linear-gradient(180deg, rgba(219, 234, 254, 0.62), rgba(255, 255, 255, 0.18));
}

.project-map-hill {
  position: absolute;
  bottom: 25%;
  width: 260px;
  height: 150px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(145deg, #bbf7d0, #22c55e 62%, #15803d);
  opacity: 0.9;
}

.project-map-hill-left { left: 4%; transform: scale(0.82); }
.project-map-hill-mid { left: 38%; bottom: 31%; transform: scale(1.08); }
.project-map-hill-right { right: 6%; transform: scale(0.9); }

.project-map-river {
  position: absolute;
  left: -8%;
  top: 39%;
  width: 42%;
  height: 58%;
  border-radius: 50%;
  background: linear-gradient(90deg, #2563eb, #bfdbfe 46%, #0284c7);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.24);
}

.project-map-path {
  position: absolute;
  left: 10%;
  top: 64%;
  width: 78%;
  height: 26%;
  border-top: 21px dotted #d9b36f;
  border-radius: 50%;
  transform: rotate(-8deg);
  opacity: 0.94;
}

.project-map-node {
  position: absolute;
  z-index: 3;
  width: 148px;
  color: #172033;
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.project-map-player {
  position: absolute;
  z-index: 4;
  width: 92px;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  color: #172033;
  text-align: center;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.project-map-player::after {
  content: "";
  width: 34px;
  height: 10px;
  margin-top: -10px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.18);
  filter: blur(2px);
}

.project-map-player img {
  display: block;
  max-width: 90px;
  max-height: 150px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 12px rgba(15, 23, 42, 0.25));
}

.project-map-player span {
  max-width: 116px;
  padding: 0.22rem 0.48rem;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(30, 58, 138, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

.project-map-player span b {
  margin-right: 0.16rem;
  color: #fde68a;
}

.project-node-building {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 58px;
  display: flex;
  align-items: end;
  justify-content: center;
  margin: 0 auto 0.35rem;
  padding-bottom: 0.35rem;
  border: 3px solid rgba(68, 64, 60, 0.36);
  border-radius: 8px 8px 12px 12px;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, 0.36) 49% 55%, transparent 56%),
    linear-gradient(180deg, #dbeafe, #2563eb);
  color: #eff6ff;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(30, 58, 138, 0.2);
}

.project-node-building::before {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  top: -20px;
  height: 29px;
  border-radius: 18px 18px 5px 5px;
  background: repeating-linear-gradient(90deg, #f59e0b 0 10px, #d97706 11px 20px);
  transform: skewX(-12deg);
}

.project-map-node-workshop .project-node-building { background: linear-gradient(180deg, #fef3c7, #f97316); color: #78350f; }
.project-map-node-dock .project-node-building { background: linear-gradient(180deg, #cffafe, #0891b2); }
.project-map-node-mine .project-node-building { background: linear-gradient(180deg, #e2e8f0, #475569); }
.project-map-node-gate .project-node-building { background: linear-gradient(180deg, #f8fafc, #64748b); }
.project-map-node-tower .project-node-building { background: linear-gradient(180deg, #ede9fe, #7c3aed); }
.project-map-node-storehouse .project-node-building { background: linear-gradient(180deg, #dcfce7, #16a34a); }

.project-node-pin {
  position: absolute;
  left: 50%;
  top: -12px;
  z-index: 4;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  transform: translateX(8px);
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.22);
}

.project-node-card {
  display: block;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(3px);
}

.project-node-card strong,
.project-dock-main strong {
  display: block;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-node-card span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
}

.project-node-card em {
  color: #0f766e;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.project-node-progress {
  overflow: hidden;
  height: 6px;
  margin: 0.35rem 0 0.25rem;
  border-radius: 999px;
  background: #dbeafe;
}

.project-node-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.project-map-node-secondary .project-node-progress i,
.project-map-node-secondary .project-node-pin { background: #64748b; }
.project-map-node-warning .project-node-progress i,
.project-map-node-warning .project-node-pin { background: #f59e0b; }
.project-map-node-danger .project-node-progress i,
.project-map-node-danger .project-node-pin { background: #dc2626; }
.project-map-node-info .project-node-progress i,
.project-map-node-info .project-node-pin { background: #0891b2; }
.project-map-node-primary .project-node-progress i,
.project-map-node-primary .project-node-pin { background: #2563eb; }
.project-map-node-success .project-node-progress i,
.project-map-node-success .project-node-pin { background: #16a34a; }

.project-map-node:hover,
.project-map-node:focus {
  z-index: 5;
  color: #172033;
  outline: 0;
}

.project-map-node:hover .project-node-building,
.project-map-node:focus .project-node-building {
  box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.34), 0 14px 24px rgba(30, 58, 138, 0.2);
}

.project-map-dock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  padding: 0.85rem;
  background: #f8fafc;
}

.project-dock-card,
.project-level-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-decoration: none;
}

.project-dock-card:hover,
.project-dock-card:focus,
.project-level-card:hover,
.project-level-card:focus {
  border-color: #60a5fa;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
  outline: 0;
}

.project-dock-index,
.project-level-badge {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-weight: 800;
}

.project-dock-main,
.project-level-main {
  min-width: 0;
  flex: 1;
}

.project-dock-main small {
  display: block;
  color: #64748b;
}

.project-game-guide {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid #dbe5e1;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
  color: #475569;
  font-size: 0.82rem;
}

.project-game-guide strong {
  color: #1d4ed8;
  font-size: 0.9rem;
}

.project-game-guide span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 0.72rem;
  border-radius: 50%;
  background: #93c5fd;
  vertical-align: middle;
}

.project-challenge-board {
  padding: 0 1rem 1rem;
}

.project-board-header {
  margin: 0 -1rem 1rem;
}

.project-level-list {
  display: grid;
  gap: 0.6rem;
}

.project-level-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-level-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.28rem;
  color: #64748b;
  font-size: 0.78rem;
}

.project-level-status {
  flex: 0 0 auto;
}

@media (max-width: 991.98px) {
  .project-expedition-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .project-map-topbar,
  .project-board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-map-rule {
    white-space: normal;
  }

  .project-map-scene {
    min-height: 520px;
  }

  .project-map-node {
    width: 132px;
  }

  .project-level-card {
    align-items: flex-start;
  }

  .project-level-title {
    white-space: normal;
  }
}

@media (max-width: 575.98px) {
  .project-summary-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .project-map-dock {
    grid-template-columns: 1fr;
  }

  .project-level-status {
    display: none;
  }
}

/* === Left Nav === */
.chapter-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3498db;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.accordion-button {
  font-size: 14px;
}

.accordion-button:not(.collapsed) {
  background-color: #edf4fc;
  color: #2c3e50;
}

.nav-assignment {
  cursor: pointer;
  font-size: 13px;
  border: none !important;
  transition: background-color 0.15s;
}

.nav-assignment:hover {
  background-color: #e9ecef;
}

.nav-assignment.active {
  background-color: #3498db !important;
  color: #fff !important;
}

/* === Center Content === */
.content-wrapper {
  max-width: 900px;
}

.assignment-content h1 {
  font-size: 1.6rem;
  color: #2c3e50;
  margin-top: 1.5rem;
}

.assignment-content h2 {
  font-size: 1.35rem;
  color: #2c3e50;
  border-left: 4px solid #3498db;
  padding-left: 12px;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.assignment-content h3 {
  font-size: 1.15rem;
  color: #34495e;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}

.assignment-content p {
  line-height: 1.8;
  margin-bottom: 0.8rem;
}

.assignment-content ul,
.assignment-content ol {
  padding-left: 1.5rem;
}

.assignment-content li {
  margin-bottom: 0.4rem;
  line-height: 1.8;
}

.assignment-content strong {
  color: #2c3e50;
}

/* === Tables === */
.assignment-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.assignment-content table td,
.assignment-content table th {
  border: 1px solid #dee2e6;
  padding: 10px 14px;
}

.assignment-content table tr:first-child td {
  background: #f8f9fa;
  font-weight: 600;
}

/* === Code Blocks (gray background) === */
.assignment-content pre,
pre.code-block {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-left: 3px solid #6c757d;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0.8rem 0;
  color: #24292e;
  white-space: pre;
}

.assignment-content pre code,
pre.code-block code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
  display: block;
}

/* === DOCX 伪表格容器（拆掉 Word 的画框表格后留下的容器） === */
.assignment-content .docx-box {
  background: #fafbfc;
  border: 1px solid #eaecef;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 0.9rem 0;
}

.assignment-content .docx-box > p:last-child {
  margin-bottom: 0;
}

.assignment-content .docx-box > pre.code-block {
  margin: 0.4rem 0;
}

/* === 情景导入：场景描述 + 导师/小白对话气泡 === */
.assignment-content .scenario-block {
  margin: 0.6rem 0 1.4rem;
  padding: 1rem 1.2rem 0.6rem;
  background: linear-gradient(180deg, #fafcff 0%, #f3f7fc 100%);
  border-left: 4px solid #3498db;
  border-radius: 0 8px 8px 0;
}

.assignment-content .scenario-scene {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.85rem;
  background: #fffbe6;
  border: 1px dashed #e6c869;
  border-radius: 6px;
  color: #5b4a17;
  font-size: 0.95rem;
  line-height: 1.7;
}

.assignment-content .scenario-label {
  display: inline-block;
  margin-right: 0.55rem;
  padding: 0 0.45rem;
  background: #e6c869;
  color: #5b4a17;
  font-weight: 600;
  font-size: 0.78rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.assignment-content .dialogue {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.55rem 0;
  font-size: 0.96rem;
  line-height: 1.75;
}

.assignment-content .dialogue-role {
  flex: 0 0 auto;
  min-width: 2.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.05em;
  margin-top: 0.18rem;
}

.assignment-content .dialogue-mentor .dialogue-role {
  background: #d5e8fa;
  color: #1a4d80;
}

.assignment-content .dialogue-novice .dialogue-role {
  background: #d8efdc;
  color: #1f6b3a;
}

.assignment-content .dialogue-bubble {
  flex: 1;
  padding: 0.5rem 0.85rem;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  color: #2d3a48;
}

.assignment-content .dialogue-mentor .dialogue-bubble {
  border-color: #c8def4;
}

.assignment-content .dialogue-novice .dialogue-bubble {
  border-color: #cbe5d3;
}

.assignment-content .dialogue-bubble code {
  font-size: 0.88em;
}

/* 情景对话折叠开关 */
.assignment-content .scenario-dialogue-fold {
  margin-top: 0.6rem;
}

.assignment-content .scenario-dialogue-fold > summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: #ebf3fa;
  border: 1px solid #c8def4;
  border-radius: 999px;
  color: #1a4d80;
  font-size: 0.88rem;
  font-weight: 500;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}

.assignment-content .scenario-dialogue-fold > summary::-webkit-details-marker {
  display: none;
}

.assignment-content .scenario-dialogue-fold > summary::before {
  content: '▶';
  font-size: 0.7rem;
  transition: transform 0.18s ease;
}

.assignment-content .scenario-dialogue-fold[open] > summary::before {
  transform: rotate(90deg);
}

.assignment-content .scenario-dialogue-fold > summary:hover {
  background: #dceaf6;
}

.assignment-content .scenario-dialogue-fold[open] > summary {
  margin-bottom: 0.6rem;
}

.assignment-content .scenario-dialogue-body {
  padding-left: 0.1rem;
}

/* === 任务折叠块（默认收起，学生点击展开） === */
.assignment-content .task-section {
  margin: 1rem 0;
  border: 1px solid #d6e4f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.assignment-content .task-section[open] {
  border-color: #3498db;
  box-shadow: 0 1px 4px rgba(52, 152, 219, 0.08);
}

.assignment-content .task-summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a4d80;
  background: linear-gradient(180deg, #f5f9fd 0%, #ebf3fa 100%);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.assignment-content .task-summary::-webkit-details-marker {
  display: none;
}

.assignment-content .task-summary::before {
  content: '▶';
  font-size: 0.75rem;
  color: #3498db;
  transition: transform 0.18s ease;
  display: inline-block;
}

.assignment-content .task-section[open] > .task-summary::before {
  transform: rotate(90deg);
}

.assignment-content .task-summary:hover {
  background: linear-gradient(180deg, #ebf3fa 0%, #dceaf6 100%);
}

.assignment-content .task-body {
  padding: 0.6rem 1.1rem 1rem;
}

.assignment-content .task-body > h3:first-child {
  margin-top: 0.6rem;
}

/* 紧邻代码块的孤立 "python"/"html" 语言标签段 */
.assignment-content .docx-box > p:first-child em,
.assignment-content .docx-box > p:first-child {
  /* 若整段只是 "python" 或 "html"，让它弱化为标签 */
}

.assignment-content .docx-box > p:first-child:has(+ pre.code-block) {
  font-size: 12px;
  color: #6a737d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.assignment-content code {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
}

/* Inline code */
.assignment-content p code,
.assignment-content li code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: #c7254e;
}

/* === Images in content === */
.assignment-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.5rem 0;
}

/* === Right Panel === */
#submit-status .alert {
  font-size: 13px;
}

#submit-preview img {
  max-height: 150px;
  border-radius: 4px;
}

#file-preview img {
  max-height: 200px;
}

.selected-image-remove,
.submitted-image-delete {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  padding: 0;
  line-height: 18px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.submission-shot-guide {
  background: #f6f8fb;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #4b5563;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.45rem 0.55rem;
}

.submission-shot-guide strong {
  color: #1f2937;
}

.submission-shot-guide-title {
  color: #1d4ed8;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

/* === AI coach feedback === */
.ai-feedback {
  font-size: 0.95rem;
}

.ai-feedback .ai-coach-score {
  padding: 0.65rem 0.8rem;
  border: 1px solid #d8ecdf;
  border-radius: 8px;
  background: #f4fbf6;
}

.ai-feedback .ai-coach-section {
  margin-top: 0.85rem;
}

.ai-feedback .ai-coach-section h6 {
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: #215d3a;
}

.ai-feedback .ai-coach-priority {
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-left: 4px solid #198754;
  border-radius: 0 8px 8px 0;
  background: #f8fbf9;
}

.ai-feedback .ai-coach-goal {
  padding: 0.7rem 0.8rem;
  border: 1px solid #bee5c8;
  border-radius: 8px;
  background: #effaf2;
}

/* === Responsive === */
@media (max-width: 768px) {
  .d-flex.course-shell {
    flex-direction: column;
  }
  #left-panel, #right-panel {
    width: 100% !important;
    min-width: unset;
    max-height: 40vh;
  }
}
