/* =========================================================================
   HADRL Week-1 · Inner Sphere 3D HUD & Multi-Page Visual Micro Lessons
   Hologram Palette: Amber-Gold (#ffb84d, #ff9d2e) & Electric Cyan (#00d8ff, #9beeff)
   ========================================================================= */

:root {
  --hangar-black: #02050a;
  --hangar-deep: #050b16;
  --amber-core: #ff9d2e;
  --amber-bright: #ffd27a;
  --amber-gold: #ffb84d;
  --amber-glow: rgba(255, 157, 46, 0.45);
  --cyan-core: #00d8ff;
  --cyan-bright: #9beeff;
  --elec-blue: #1a8cff;
  --cyan-glow: rgba(0, 216, 255, 0.42);
  --panel-Alpha: 0.55;
  --mono: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --sphere-radius: 960px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02050a;
  font-family: var(--sans);
  color: #e6f3ff;
  user-select: none;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}
.page-shell.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
.page-shell.sidebar-collapsed .panel {
  display: none;
}

@media (min-width: 1600px) {
  .page-shell:not(.sidebar-collapsed) {
    grid-template-columns: minmax(0, 1fr) 400px;
  }
}
@media (max-width: 920px) {
  .page-shell,
  .page-shell:not(.sidebar-collapsed) {
    grid-template-columns: 1fr;
    height: 100vh;
  }
}

/* Stage Wrap & Ambient Light */
.stage-wrap {
  position: relative;
  cursor: grab;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  width: 100%;
  padding: 56px 1.5vw 12px;
  background:
    radial-gradient(1200px 520px at 50% 0%, rgba(255, 174, 66, 0.22), transparent 72%),
    radial-gradient(1300px 700px at 50% 50%, rgba(0, 216, 255, 0.22), transparent 75%),
    radial-gradient(960px 420px at 50% 100%, rgba(255, 174, 66, 0.2), transparent 74%),
    linear-gradient(180deg, #030813 0%, #061122 45%, #030814 100%);
  overflow: hidden;
}
.stage-wrap.view-flat {
  cursor: default;
  overflow-y: auto;
}
.stage-wrap.dragging {
  cursor: grabbing;
}

/* Topbar & Command Cluster */
.stage-topbar {
  position: absolute;
  top: 8px;
  left: 1.5vw;
  right: 1.5vw;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 50;
  pointer-events: auto;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-emblem {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.brand-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(255, 184, 77, 0.45));
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.title-mark {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffd27a;
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.6);
}
.title-sub {
  font-size: 10.5px;
  color: #8fbcd8;
  white-space: nowrap;
}

/* Sphere Compass Nav */
.sphere-compass {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(4, 12, 22, 0.78);
  border: 1px solid rgba(0, 216, 255, 0.32);
  border-radius: 20px;
  padding: 2px 6px;
  box-shadow: 0 0 16px rgba(0, 216, 255, 0.18), inset 0 0 10px rgba(0, 0, 0, 0.6);
}
.compass-nav-btn {
  background: none;
  border: none;
  color: #9beeff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  border-radius: 4px;
  transition: all 140ms ease;
}
.compass-nav-btn:hover {
  color: #ffd27a;
  transform: scale(1.15);
}
.compass-pills {
  display: flex;
  gap: 4px;
}
.compass-pill {
  background: transparent;
  border: 1px solid transparent;
  color: #90b8d4;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}
.compass-pill:hover {
  color: #e6f3ff;
  border-color: rgba(0, 216, 255, 0.35);
  background: rgba(0, 216, 255, 0.08);
}
.compass-pill.active {
  color: #ffd27a;
  background: rgba(255, 157, 46, 0.18);
  border-color: rgba(255, 184, 77, 0.7);
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.35);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(4, 16, 30, 0.88);
  border: 1px solid rgba(0, 216, 255, 0.45);
  border-radius: 8px;
  padding: 2px 6px;
  box-shadow: 0 0 12px rgba(0, 216, 255, 0.18), inset 0 0 8px rgba(0, 0, 0, 0.5);
}
.zoom-track {
  position: relative;
  width: 96px;
  height: 6px;
  background: rgba(1, 10, 20, 0.85);
  border: 1px solid rgba(0, 216, 255, 0.35);
  border-radius: 3px;
  cursor: pointer;
}
.zoom-track-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #00d8ff, #ffd27a);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 216, 255, 0.6);
  pointer-events: none;
}
.zoom-track-thumb {
  position: absolute;
  top: 50%;
  left: 40%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd27a;
  border: 1.5px solid #00d8ff;
  box-shadow: 0 0 8px #ffd27a;
  pointer-events: none;
}
.zoom-btn {
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  min-width: 26px;
  line-height: 1;
}
.zoom-level-text {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffd27a;
  padding: 0 4px;
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.6);
}

.topbar-btn {
  background: rgba(6, 18, 32, 0.75);
  border: 1px solid rgba(0, 216, 255, 0.35);
  color: #c9e8fb;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 140ms ease;
}
.topbar-btn:hover {
  background: rgba(10, 28, 50, 0.9);
  border-color: rgba(255, 184, 77, 0.65);
  color: #ffd27a;
}
.topbar-btn.accent {
  background: rgba(255, 157, 46, 0.16);
  border-color: rgba(255, 184, 77, 0.55);
  color: #ffd27a;
}

/* 3D Scene Root & Inner Sphere Construction */
.scene-root {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1100px;
  perspective-origin: 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Spherical Wireframe Background */
.sphere-wireframe {
  position: absolute;
  width: 1920px;
  height: 1920px;
  pointer-events: none;
  transform-style: preserve-3d;
  opacity: 0.52;
  transition: opacity 280ms ease;
}
.wire-latitude {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(0, 216, 255, 0.42);
  transform-origin: 50% 50%;
}
.lat-equator {
  width: 2000px;
  height: 2000px;
  transform: translate(-50%, -50%) rotateX(90deg);
  border-color: rgba(255, 184, 77, 0.65);
  border-width: 1.8px;
  box-shadow: 0 0 24px rgba(255, 184, 77, 0.4), inset 0 0 24px rgba(255, 184, 77, 0.25);
}
.lat-north-1 {
  width: 1650px;
  height: 1650px;
  transform: translate(-50%, -50%) rotateX(90deg) translateZ(480px);
  border-color: rgba(0, 216, 255, 0.35);
}
.lat-south-1 {
  width: 1650px;
  height: 1650px;
  transform: translate(-50%, -50%) rotateX(90deg) translateZ(-480px);
  border-color: rgba(0, 216, 255, 0.35);
}
.wire-meridian {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2000px;
  height: 2000px;
  border-radius: 50%;
  border: 1px solid rgba(0, 216, 255, 0.32);
  transform-origin: 50% 50%;
}
.mer-0 { transform: translate(-50%, -50%) rotateY(0deg); }
.mer-90 { transform: translate(-50%, -50%) rotateY(90deg); }
.mer-180 { transform: translate(-50%, -50%) rotateY(180deg); }
.mer-270 { transform: translate(-50%, -50%) rotateY(270deg); }

.sphere-core-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 216, 255, 0.16) 0%, rgba(255, 157, 46, 0.09) 35%, transparent 70%);
  border-radius: 50%;
}

/* The Sphere World Rig: Camera at Centre */
.sphere-world {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* 4 Inner Sphere Faces */
.sphere-face {
  position: absolute;
  width: min(88vw, 1480px);
  height: min(82vh, 820px);
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  opacity: 0.8;
  filter: brightness(0.85) saturate(0.95);
  transition: opacity 320ms ease, filter 320ms ease;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.sphere-face.face-active {
  opacity: 1;
  filter: brightness(1.05) saturate(1.05);
  pointer-events: auto;
  z-index: 10;
}
.sphere-face.face-adjacent {
  opacity: 0.65;
  filter: brightness(0.82) blur(0.2px);
  pointer-events: auto;
  cursor: pointer;
}

/* Face Layout Coordinates on Inner Sphere (Radius R = 960px) */
.face-curved-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(4, 14, 26, 0.72);
  border: 1.5px solid rgba(0, 216, 255, 0.52);
  border-radius: 14px;
  box-shadow:
    0 0 42px rgba(0, 216, 255, 0.28),
    inset 0 0 36px rgba(0, 216, 255, 0.14),
    0 24px 64px rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 16px 20px;
  overflow: hidden;
  box-sizing: border-box;
}
.sphere-face.face-active .face-curved-wrapper {
  border-color: rgba(0, 216, 255, 0.68);
  box-shadow:
    0 0 54px rgba(0, 216, 255, 0.35),
    inset 0 0 42px rgba(0, 216, 255, 0.18),
    0 24px 72px rgba(0, 0, 0, 0.92);
}

.face-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 216, 255, 0.32);
  padding-bottom: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.face-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.face-order-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-gold);
  background: rgba(255, 157, 46, 0.18);
  border: 1px solid rgba(255, 184, 77, 0.55);
  padding: 1px 6px;
  border-radius: 4px;
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.5);
}
.face-main-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #f7fcff;
  letter-spacing: 0.04em;
  text-shadow: 0 0 14px rgba(0, 216, 255, 0.55), 0 0 28px rgba(0, 216, 255, 0.25);
}
.face-status-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #b0daf2;
  background: rgba(6, 24, 44, 0.75);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 216, 255, 0.35);
}

.face-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

/* =========================================================================
   Face 0: 方案台 (Tasks Console)
   ========================================================================= */
.holo-tasks-console {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}
.tasks-strip-panel {
  width: 100%;
  height: 100%;
  background: rgba(6, 20, 36, 0.55);
  border: 1px solid rgba(0, 216, 255, 0.42);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 0 28px rgba(0, 216, 255, 0.2);
  display: flex;
  flex-direction: column;
}
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  transform-style: preserve-3d;
}

.task-card-mini {
  background: linear-gradient(180deg, rgba(12, 34, 58, 0.92), rgba(6, 22, 40, 0.88));
  border: 1px solid rgba(0, 216, 255, 0.45);
  border-radius: 8px;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 168px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 0 20px rgba(0, 216, 255, 0.1);
}
.task-card-mini:hover {
  border-color: rgba(255, 184, 77, 0.8);
  background: rgba(14, 38, 66, 0.95);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 184, 77, 0.35);
  transform: translateY(-2px);
}
.task-name {
  font-size: 15px;
  font-weight: 700;
  color: #f7fcff;
  line-height: 1.35;
}
.task-cadence-line {
  font-size: 11px;
  color: #c5e3f7;
  line-height: 1.35;
}
.task-cadence-text {
  word-break: break-all;
}
.task-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  border-top: 1px dashed rgba(0, 216, 255, 0.28);
  padding-top: 5px;
}
.task-scope-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: #b3f2ff;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 216, 255, 0.16);
  border: 1px solid rgba(0, 216, 255, 0.3);
}
.task-chip {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.chip-paused {
  color: #ffd890;
  background: rgba(255, 157, 46, 0.22);
  border: 1px solid rgba(255, 184, 77, 0.6);
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.25);
}
.chip-planned {
  color: #a4edff;
  background: rgba(0, 216, 255, 0.2);
  border: 1px solid rgba(0, 216, 255, 0.65);
  box-shadow: 0 0 8px rgba(0, 216, 255, 0.25);
}
.chip-intent {
  color: #e2f0fa;
  background: rgba(45, 75, 105, 0.5);
  border: 1px dashed rgba(175, 220, 250, 0.65);
}
.task-source-hint {
  font-size: 10px;
  color: #92b7d0;
  line-height: 1.3;
}

/* =========================================================================
   Face 1: 小课堂 (Micro Lessons & Visual Animations & Knowledge Mesh)
   ========================================================================= */
.lesson-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.lesson-container {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}

/* Lesson Left Rail: Knowledge Network & Lesson Index */
.lesson-rail {
  background: rgba(4, 16, 28, 0.78);
  border: 1px solid rgba(0, 216, 255, 0.38);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  box-shadow: 0 0 16px rgba(0, 216, 255, 0.1);
}
.lesson-rail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 216, 255, 0.3);
  padding-bottom: 6px;
}
.lesson-rail-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffd27a;
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.5);
}
.knowledge-network-btn {
  background: rgba(0, 216, 255, 0.18);
  border: 1px solid rgba(0, 216, 255, 0.5);
  color: #9beeff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 140ms ease;
}
.knowledge-network-btn:hover,
.knowledge-network-btn.active {
  background: rgba(255, 157, 46, 0.25);
  border-color: rgba(255, 184, 77, 0.75);
  color: #ffd27a;
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.4);
}
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lesson-list-item {
  background: rgba(8, 24, 42, 0.72);
  border: 1px solid rgba(0, 216, 255, 0.28);
  border-radius: 5px;
  padding: 7px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 140ms ease;
  text-align: left;
}
.lesson-list-item:hover {
  background: rgba(14, 34, 58, 0.9);
  border-color: rgba(0, 216, 255, 0.55);
}
.lesson-list-item.active {
  background: rgba(255, 157, 46, 0.22);
  border-color: rgba(255, 184, 77, 0.85);
  box-shadow: 0 0 14px rgba(255, 184, 77, 0.35);
}
.item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.item-order {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: #ffd27a;
}
.item-dir {
  font-size: 9.5px;
  font-weight: 600;
  color: #a4cbe6;
}
.item-title {
  font-size: 12px;
  font-weight: 700;
  color: #f7fcff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lesson Main Content & Visual Card */
.lesson-main-view {
  background: rgba(4, 16, 28, 0.78);
  border: 1.5px solid rgba(0, 216, 255, 0.42);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 24px rgba(0, 216, 255, 0.16);
}

.lesson-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 216, 255, 0.3);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.lesson-heading-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.lesson-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffd27a;
  background: rgba(255, 157, 46, 0.2);
  border: 1px solid rgba(255, 184, 77, 0.55);
  padding: 1px 7px;
  border-radius: 4px;
}
.lesson-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #f7fcff;
  text-shadow: 0 0 10px rgba(0, 216, 255, 0.45);
}
.page-indicator-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-pos-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: #9beeff;
}
.page-dots {
  display: flex;
  gap: 4px;
}
.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 216, 255, 0.25);
  cursor: pointer;
  transition: all 140ms ease;
}
.page-dot.active {
  background: #ffd27a;
  box-shadow: 0 0 6px rgba(255, 184, 77, 0.8);
  transform: scale(1.2);
}

/* Visual Stage Area (Code-based animations + idea beats) */
.lesson-visual-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 0;
  padding: 8px 0;
}
@media (max-width: 900px) {
  .lesson-container {
    grid-template-columns: 1fr;
  }
  .lesson-rail {
    display: none;
  }
  .lesson-visual-layout {
    grid-template-columns: 1fr;
  }
}

.lesson-page-narrative {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}
.page-beat-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffd27a;
  letter-spacing: 0.02em;
}
.page-beat-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #d6ecfb;
}
.lesson-note-callout {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 4px;
}
.lesson-note-callout[data-kind="boundary"] {
  border-left: 3px solid #ff5c4d;
  background: rgba(255, 92, 77, 0.1);
  color: #ffb5ad;
}
.lesson-note-callout[data-kind="practice"] {
  border-left: 3px solid #00d8ff;
  background: rgba(0, 216, 255, 0.08);
  color: #a6ecff;
}
.lesson-note-callout[data-kind="interpretation"] {
  border-left: 3px dashed #ffb84d;
  background: rgba(255, 184, 77, 0.08);
  color: #ffd996;
}
.lesson-note-callout[data-kind="fact"] {
  border-left: 3px solid #1a8cff;
  background: rgba(26, 140, 255, 0.1);
  color: #bde0ff;
}

/* Related Network Pills */
.related-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.related-hint {
  font-size: 10.5px;
  color: #7da5c0;
}
.related-pill {
  background: rgba(0, 216, 255, 0.08);
  border: 1px solid rgba(0, 216, 255, 0.3);
  color: #9beeff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 140ms ease;
}
.related-pill:hover {
  background: rgba(255, 157, 46, 0.18);
  border-color: rgba(255, 184, 77, 0.55);
  color: #ffd27a;
}

/* Animation Canvas Container */
.lesson-canvas-container {
  width: 100%;
  height: 100%;
  min-height: 240px;
  max-height: 380px;
  background: rgba(3, 9, 18, 0.85);
  border: 1px solid rgba(0, 216, 255, 0.32);
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.lesson-canvas {
  width: 100%;
  height: 100%;
}

/* Lesson Bottom Nav Controls */
.lesson-bottom-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 216, 255, 0.2);
  padding-top: 8px;
  margin-top: 8px;
}
.nav-arrow-btn {
  background: rgba(6, 18, 32, 0.8);
  border: 1px solid rgba(0, 216, 255, 0.35);
  color: #c9e8fb;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 140ms ease;
}
.nav-arrow-btn:hover:not(:disabled) {
  border-color: rgba(255, 184, 77, 0.65);
  color: #ffd27a;
  background: rgba(12, 28, 48, 0.9);
}
.nav-arrow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-key-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #799db6;
}

/* Knowledge Network Modal / Overlay in Lesson Face */
.knowledge-network-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}
.network-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 216, 255, 0.25);
  margin-bottom: 8px;
}
.network-canvas-host {
  flex: 1 1 auto;
  position: relative;
  border-radius: 8px;
  background: rgba(2, 6, 14, 0.9);
  border: 1px solid rgba(0, 216, 255, 0.3);
  overflow: hidden;
}

/* =========================================================================
   Face 2: 额度 (Main Deck Quota Wings) & Wrap Geometry
   ========================================================================= */
.sphere-face.face-quota {
  transform-style: preserve-3d;
}
.sphere-face.face-quota .face-curved-wrapper {
  transform-style: preserve-3d;
  transition: background 300ms ease, border-color 300ms ease, box-shadow 300ms ease, padding 300ms ease;
}

/* When quota face is active and wrapping or at high focus:
   drop the single enclosing glass and header so the three yawed
   boards float in the hangar like the 051 top-half wrap (card-sized, not door-tall). */
.sphere-face.face-quota.is-focus-wrap .face-curved-wrapper {
  overflow: visible !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 8px 10px 12px;
}
.sphere-face.face-quota.is-focus-wrap {
  overflow: visible !important;
}

.sphere-face.face-quota.is-focus-wrap .face-header {
  display: none;
}

.sphere-face.face-quota.is-focus-wrap .face-body {
  justify-content: center;
}

.sphere-face.face-quota.is-focus-wrap .holo-deck-main {
  align-items: center;
  height: 100%;
  gap: 28px;
  padding: 0 18px;
}

.sphere-face.face-quota.is-focus-wrap .holo-panel.ai-wing {
  height: auto;
  max-height: min(640px, 74vh);
  justify-content: flex-start;
}

.sphere-face.face-quota .face-body {
  transform-style: preserve-3d;
  overflow: visible;
  justify-content: stretch;
}

.holo-deck-main {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1.18fr 1fr;
  gap: 22px;
  align-items: stretch;
  transform-style: preserve-3d;
}
@media (max-width: 1100px) {
  .holo-deck-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.holo-panel.ai-wing {
  position: relative;
  background: rgba(6, 20, 36, 0.82);
  border: 1.5px solid rgba(0, 216, 255, 0.45);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 0 28px rgba(0, 216, 255, 0.18), inset 0 0 20px rgba(0, 216, 255, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.holo-panel.ai-wing:hover {
  border-color: rgba(255, 184, 77, 0.8);
  box-shadow: 0 0 36px rgba(255, 184, 77, 0.3), inset 0 0 24px rgba(255, 184, 77, 0.12);
}
.holo-panel.ai-wing.theme-amber {
  border-color: rgba(255, 157, 46, 0.6);
  box-shadow: 0 0 28px rgba(255, 157, 46, 0.22), inset 0 0 20px rgba(255, 157, 46, 0.08);
}
.holo-panel.ai-wing.spotlight {
  border-color: #ffd27a;
  box-shadow: 0 0 38px rgba(255, 184, 77, 0.45);
}

.wing-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.wing-badge {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.wing-badge svg {
  width: 100%;
  height: 100%;
}
.wing-title-block {
  flex: 1 1 auto;
}
.wing-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.wing-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #f7fcff;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(0, 216, 255, 0.4);
}
.wing-sub-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #ffd27a;
  background: rgba(255, 157, 46, 0.18);
  border: 1px solid rgba(255, 184, 77, 0.5);
  padding: 1px 6px;
  border-radius: 4px;
}
.wing-sub-pill.cyan {
  color: #9beeff;
  background: rgba(0, 216, 255, 0.18);
  border: 1px solid rgba(0, 216, 255, 0.5);
}
.wing-reset-line {
  font-size: 11px;
  color: #a4c9e2;
  margin-top: 2px;
}

.wing-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wing-hero-nums {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wing-primary-num {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 900;
  color: #ffd27a;
  letter-spacing: 0.03em;
  text-shadow: 0 0 12px rgba(255, 184, 77, 0.65), 0 0 24px rgba(255, 184, 77, 0.35);
}
.wing-primary-num.cyan {
  color: #9beeff;
  text-shadow: 0 0 12px rgba(0, 216, 255, 0.65), 0 0 24px rgba(0, 216, 255, 0.35);
}
.wing-secondary-num {
  font-size: 11.5px;
  font-weight: 600;
  color: #b0d6ee;
}
.wing-gauge-canvas {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 216, 255, 0.3));
}

/* Antigravity Group Bars */
.agy-face-groups {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.agy-face-group {
  background: rgba(4, 14, 26, 0.72);
  border: 1px solid rgba(0, 216, 255, 0.28);
  border-radius: 5px;
  padding: 6px 9px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}
.agy-group-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
}
.agy-group-name {
  font-weight: 700;
  color: #f0f7ff;
}
.agy-metric-pill.amber {
  color: #ffd27a;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(255, 184, 77, 0.4);
}
.agy-metric-pill.cyan {
  color: #9beeff;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(0, 216, 255, 0.4);
}
.agy-group-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.agy-group-bar-fill.amber {
  height: 100%;
  background: linear-gradient(90deg, #ff9d2e, #ffd27a);
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.75);
}
.agy-group-bar-fill.cyan {
  height: 100%;
  background: linear-gradient(90deg, #00d8ff, #9beeff);
  box-shadow: 0 0 8px rgba(0, 216, 255, 0.75);
}
.agy-group-reset {
  font-size: 10px;
  color: #9cc0d8;
}

.holo-ruler {
  width: 100%;
  margin: 6px 0;
}
.holo-ruler-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.holo-ruler-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff9d2e, #ffd27a);
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.75);
}
.holo-ruler-fill.cyan-amber {
  background: linear-gradient(90deg, #00d8ff, #ffd27a);
  box-shadow: 0 0 8px rgba(0, 216, 255, 0.75);
}

.wing-fold summary {
  font-size: 11px;
  color: #9ec3dc;
  cursor: pointer;
  padding: 2px 0;
}
.wing-kv {
  list-style: none;
  padding: 5px 0 0;
  margin: 0;
  font-size: 11px;
  color: #a8cae2;
  line-height: 1.5;
}

/* =========================================================================
   Face 3: 各 agents (Agents Hangar - 8 Core Roles)
   ========================================================================= */
.hangar-figures {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  padding: 4px 0;
}

.hangar-figure {
  background: rgba(6, 20, 36, 0.78);
  border: 1px solid rgba(0, 216, 255, 0.42);
  border-radius: 8px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 180ms ease;
  position: relative;
  box-shadow: 0 0 16px rgba(0, 216, 255, 0.14);
}
.hangar-figure:hover {
  border-color: rgba(255, 184, 77, 0.85);
  background: rgba(14, 34, 56, 0.95);
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7), 0 0 24px rgba(255, 184, 77, 0.4);
}
.figure-portrait-frame {
  width: min(132px, 70%);
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1.8px solid rgba(0, 216, 255, 0.75);
  overflow: hidden;
  box-shadow: 0 0 22px rgba(0, 216, 255, 0.55), inset 0 0 14px rgba(0, 216, 255, 0.25);
  position: relative;
  background: rgba(2, 10, 20, 0.95);
}
.role-avatar.figure-portrait {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
}
.figure-pedestal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.figure-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #f7fcff;
  text-shadow: 0 0 8px rgba(0, 216, 255, 0.4);
}
.figure-state {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #9cc0d8;
}

/* =========================================================================
   Sidebar & Optical Controls
   ========================================================================= */
.panel {
  background: rgba(3, 9, 18, 0.94);
  border-left: 1px solid rgba(0, 216, 255, 0.28);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 60;
}
.sidebar-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.sidebar-brand {
  font-family: var(--mono);
  font-size: 10px;
  color: #00d8ff;
  letter-spacing: 0.1em;
}
.panel h1 {
  margin: 2px 0 0;
  font-size: 15px;
  color: #f2f9ff;
}
.panel h2 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #ffd27a;
}
.panel-actions {
  display: flex;
  gap: 8px;
}
.panel button.primary {
  flex: 1 1 auto;
  background: rgba(255, 157, 46, 0.2);
  border: 1px solid rgba(255, 184, 77, 0.6);
  color: #ffd27a;
  padding: 6px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}
.chip {
  background: rgba(6, 18, 32, 0.75);
  border: 1px solid rgba(0, 216, 255, 0.3);
  color: #c9e8fb;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: rgba(255, 157, 46, 0.2);
  border-color: rgba(255, 184, 77, 0.7);
  color: #ffd27a;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quota-card {
  background: rgba(6, 18, 32, 0.6);
  border: 1px solid rgba(0, 216, 255, 0.22);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}
.quota-card.active {
  border-color: #ffd27a;
  box-shadow: 0 0 12px rgba(255, 184, 77, 0.3);
}
.quota-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.quota-card-title {
  margin: 0;
  font-size: 12px;
  color: #f2f9ff;
}
.hero-figures {
  display: flex;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0;
}
.hero-figures .amber { color: #ffd27a; }
.mini-meter-sub {
  font-size: 10px;
  color: #7ca2bd;
}

.sidebar-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(6, 18, 32, 0.5);
  border: 1px solid rgba(0, 216, 255, 0.15);
  margin-bottom: 4px;
}
.sidebar-task-name { font-size: 11px; font-weight: 600; color: #f2f9ff; }
.sidebar-task-cadence { font-size: 9.5px; color: #8cb1cb; }

/* Flat View Override: One Full-screen Face at a Time */
.view-flat .sphere-world {
  transform: none !important;
  perspective: none !important;
}
.view-flat .sphere-wireframe {
  display: none;
}
.view-flat .sphere-face {
  position: absolute;
  top: 50px;
  left: 2vw;
  right: 2vw;
  bottom: 14px;
  width: auto;
  height: auto;
  display: none;
  transform-origin: center center;
  transition: transform 220ms ease;
}
.view-flat .sphere-face.face-active {
  display: flex;
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  .sphere-world,
  .sphere-face,
  .lesson-list-item,
  .task-card-mini,
  .hangar-figure,
  .holo-panel.ai-wing {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Compact chrome and stacked faces on narrow viewports */
@media (max-width: 1100px) {
  .stage-topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    row-gap: 6px;
    padding: 6px 10px;
  }
  .sphere-compass {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .compass-pill { font-size: 11px; padding: 3px 7px; }
  .holo-deck-main,
  .hangar-figures {
    overflow: auto;
  }
}
@media (max-width: 720px) {
  .title-sub { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .zoom-track { width: 64px; }
  .zoom-level-text { min-width: 44px; font-size: 10px; padding: 0 2px; }
  .sphere-face {
    width: 96vw;
    height: calc(100% - 96px);
  }
  .holo-deck-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .hangar-figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .face-header { flex-wrap: wrap; gap: 6px; }
  .face-main-title { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .sphere-world { transition: none !important; }
}

/* Narrow / phone: one full-screen face at a time, no clipped 3D side panels */
body.is-narrow .stage-wrap,
.stage-wrap.is-narrow {
  padding: 170px 8px 10px;
  cursor: default;
}
body.is-narrow .sphere-wireframe { display: none; }
body.is-narrow .sphere-world {
  transform: none !important;
}
body.is-narrow .sphere-face {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0;
  filter: none;
  backface-visibility: visible;
  pointer-events: none;
  display: none;
  transform-origin: center center;
  transition: transform 220ms ease;
}
body.is-narrow .sphere-face.face-active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
body.is-narrow .face-curved-wrapper {
  backdrop-filter: blur(8px);
}
body.is-narrow .face-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-narrow .tasks-grid,
body.is-narrow .hangar-figures {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.is-narrow .task-card-mini { min-height: 120px; padding: 10px; }
body.is-narrow .task-name { font-size: 13px; }
body.is-narrow .figure-portrait-frame { width: min(96px, 80%); }
body.is-narrow .lesson-visual-layout { grid-template-columns: 1fr; }
body.is-narrow .lesson-rail { max-height: 120px; overflow: auto; }

/* Snap the first camera pose so deep links and first paint are not mid-transition. */
html.is-booting .sphere-world,
html.is-booting .sphere-face {
  transition: none !important;
}
