/* Youning Academy · 3D knowledge assistant · isolated from shared site styles */
:root {
  --ynq-assistant-gold: #d7a632;
  --ynq-assistant-gold-soft: #f3d57b;
  --ynq-assistant-ink: #11120f;
  --ynq-assistant-blue: #4d7dff;
  --ynq-assistant-cyan: #55dcff;
}

.course-assistant-fab {
  --core-x: 0deg;
  --core-y: 0deg;
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 90;
  width: 92px;
  height: 92px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  isolation: isolate;
}

.course-assistant-fab::before {
  display: none;
}

.course-assistant-fab:hover,
.course-assistant-fab:focus-visible {
  outline: 0;
  transform: translateY(-2px);
}

.course-assistant-fab:hover .ynq-knowledge-core,
.course-assistant-fab:focus-visible .ynq-knowledge-core {
  filter: drop-shadow(0 14px 18px rgba(31, 55, 126, .38)) drop-shadow(0 0 10px rgba(85, 220, 255, .2));
}

.course-assistant-fab-copy {
  min-width: 0;
  display: grid !important;
  gap: 4px;
  text-align: left;
}

.course-assistant-fab-copy strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: .02em;
}

.course-assistant-fab-copy small {
  margin: 0;
  color: #c8d0dc;
  font-size: 11px;
  line-height: 1.2;
}

.course-assistant-live {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #83edb8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
}

.course-assistant-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #45d891;
  box-shadow: 0 0 0 4px rgba(69,216,145,.12), 0 0 12px #45d891;
}

.ynq-knowledge-core {
  position: relative;
  width: 82px;
  height: 82px;
  display: block;
  perspective: 500px;
  transform: rotateX(var(--core-y)) rotateY(var(--core-x));
  transform-style: preserve-3d;
  transition: transform .18s ease-out;
  animation: ynq-core-float 4s ease-in-out infinite;
}

.ynq-core-shadow {
  position: absolute;
  left: 17px;
  bottom: 2px;
  width: 50px;
  height: 13px;
  border-radius: 50%;
  background: rgba(23, 41, 93, .6);
  filter: blur(7px);
  transform: translateZ(-24px);
}

.ynq-core-orbit {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(85, 220, 255, .42);
  border-radius: 50%;
  transform-style: preserve-3d;
  animation: ynq-orbit-spin 7s linear infinite;
}

.ynq-core-orbit.is-inner {
  inset: 14px;
  border-color: rgba(243, 213, 123, .38);
  transform: rotateX(68deg) rotateZ(20deg);
  animation-duration: 5s;
  animation-direction: reverse;
}

.ynq-core-orbit i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ynq-assistant-cyan);
  box-shadow: 0 0 10px currentColor;
}

.ynq-core-orbit i:nth-child(1) { top: 7px; left: 7px; }
.ynq-core-orbit i:nth-child(2) { right: -2px; top: 50%; }
.ynq-core-orbit i:nth-child(3) { left: 16px; bottom: -1px; background: var(--ynq-assistant-gold-soft); }
.ynq-core-orbit.is-inner i:nth-child(1) { top: 50%; left: -3px; background: var(--ynq-assistant-gold-soft); }
.ynq-core-orbit.is-inner i:nth-child(2) { right: 8px; bottom: 1px; }

.ynq-core-shell {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 44px;
  height: 51px;
  display: block;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px 18px 15px 15px;
  background:
    radial-gradient(circle at 32% 18%, rgba(255,255,255,.95), transparent 13%),
    linear-gradient(145deg, #c8d6ff 0%, #6e93ff 32%, #2b4fa7 72%, #15244e 100%);
  box-shadow: inset 4px 5px 10px rgba(255,255,255,.33), inset -7px -8px 12px rgba(6,18,61,.43), 0 10px 22px rgba(25,55,128,.48), 0 0 24px rgba(77,125,255,.22);
  transform: translateZ(18px);
  transform-style: preserve-3d;
}

.ynq-core-crown {
  position: absolute;
  left: 11px;
  top: -9px;
  width: 22px;
  height: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.ynq-core-crown i,
.ynq-core-crown b {
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(#fff8cc, #d9a526);
  box-shadow: 0 0 7px #e8b83d;
}

.ynq-core-crown b { height: 12px; }

.ynq-core-visor {
  position: absolute;
  left: 6px;
  top: 8px;
  width: 32px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(123, 224, 255, .78);
  border-radius: 9px;
  background: linear-gradient(180deg, #071126, #101b38);
  box-shadow: inset 0 0 9px rgba(65, 188, 255, .38), 0 2px 8px rgba(5,12,35,.5);
}

.ynq-core-visor::after {
  position: absolute;
  left: -30%;
  top: 0;
  width: 18px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  content: "";
  transform: skewX(-20deg);
  animation: ynq-visor-scan 3.4s ease-in-out infinite;
}

.ynq-core-visor i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #63e5ff;
  box-shadow: 0 0 8px #63e5ff;
  animation: ynq-eye-blink 4.8s ease-in-out infinite;
}

.ynq-core-visor b {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #61efac;
}

.ynq-core-book {
  position: absolute;
  left: 8px;
  bottom: 5px;
  width: 28px;
  height: 15px;
  display: grid;
  grid-template-columns: 1fr 8px 1fr;
  align-items: end;
  color: #1b2854;
  transform: translateZ(6px);
}

.ynq-core-book i {
  height: 13px;
  border-radius: 2px 4px 3px 2px;
  background: linear-gradient(135deg, #fff3b8, #d7a632);
  box-shadow: inset 0 1px rgba(255,255,255,.7);
}

.ynq-core-book i:last-child { transform: scaleX(-1); }
.ynq-core-book b { z-index: 1; margin: 0 -1px 2px; color: #fff; font-size: 8px; text-align: center; }

.ynq-core-signal {
  position: absolute;
  right: 8px;
  top: 17px;
  display: grid;
  gap: 3px;
}

.ynq-core-signal i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ynq-assistant-gold-soft);
  box-shadow: 0 0 9px currentColor;
  animation: ynq-signal 1.8s ease-in-out infinite;
}

.ynq-core-signal i:nth-child(2) { margin-left: 5px; animation-delay: .3s; }
.ynq-core-signal i:nth-child(3) { margin-left: 1px; animation-delay: .6s; }

.ynq-knowledge-core.is-compact {
  width: 66px;
  height: 66px;
  transform: scale(.84);
  transform-origin: center;
}

.course-assistant-nudge {
  position: fixed;
  right: 102px;
  bottom: 72px;
  z-index: 92;
  width: min(248px, calc(100vw - 132px));
  padding: 12px 15px;
  border: 1px solid #d6b66d;
  border-radius: 15px 15px 4px 15px;
  background: #fffdf8;
  color: #26251f;
  box-shadow: 0 18px 55px rgba(30,25,14,.2);
  cursor: pointer;
  animation: ynq-nudge-in .35s ease both;
}

.course-assistant-nudge[hidden] { display: none !important; }

.course-assistant-nudge::after {
  position: absolute;
  right: -9px;
  bottom: 13px;
  width: 16px;
  height: 16px;
  border-top: 1px solid #d6b66d;
  border-right: 1px solid #d6b66d;
  background: #fffdf8;
  content: "";
  transform: rotate(45deg);
}

.course-assistant-nudge span {
  position: relative;
  z-index: 1;
  display: block;
  color: #4d4a41;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.65;
}

.course-assistant-fab.is-speaking .ynq-core-shell {
  animation: ynq-core-talk .46s ease-in-out infinite alternate;
}

.course-assistant-fab.is-speaking .ynq-core-signal i {
  animation-duration: .55s;
}

.course-assistant-panel {
  position: fixed;
  right: 26px;
  bottom: 104px;
  z-index: 91;
  width: min(500px, calc(100vw - 34px));
  height: min(720px, calc(100vh - 138px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(197,151,51,.72);
  border-radius: 20px;
  background: #f7f5ee;
  box-shadow: 0 32px 100px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.25) inset;
  transform-origin: 86% 100%;
}

.course-assistant-panel.is-open { animation: ynq-panel-open .28s cubic-bezier(.2,.8,.2,1) both; }
.course-assistant-panel[hidden], .course-assistant-pane[hidden] { display: none !important; }

.course-assistant-panel > .course-assistant-head {
  min-height: 86px;
  display: grid;
  grid-template-columns: 67px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  padding: 8px 13px 8px 8px;
  background:
    radial-gradient(circle at 10% 15%, rgba(75,125,255,.23), transparent 35%),
    linear-gradient(135deg, #0c1017, #151610 70%);
  color: #fff;
}

.course-assistant-head > div { min-width: 0; display: grid; gap: 2px; }
.course-assistant-head > div small { color: #e2b74d; font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.course-assistant-head > div strong { font-size: 17px; line-height: 1.3; }
.course-assistant-head > div span { color: #aeb7c5; font-size: 11px; }
.course-assistant-panel > .course-assistant-head > button { width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: rgba(255,255,255,.05); color: #fff; font-size: 22px; cursor: pointer; }
.course-assistant-panel > .course-assistant-head > button:hover { background: rgba(255,255,255,.13); }

.course-assistant-tabs {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  padding: 0 14px;
  border-bottom: 1px solid #ddd6c6;
  background: #fffdf8;
}

.course-assistant-tabs button {
  min-height: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #79776f;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.course-assistant-tabs button span { margin-right: 5px; color: #bd8a21; }
.course-assistant-tabs button.is-active { border-bottom-color: #c9962d; color: #171813; }

.course-assistant-pane {
  min-height: 0;
  overflow: hidden;
}

#courseAssistantChatPane.is-active {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto auto auto;
}

.course-assistant-context {
  padding: 10px 16px;
  border-bottom: 1px solid #e0d6be;
  background: linear-gradient(90deg, #f4e7c9, #fbf7ed);
  color: #684b15;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-assistant-messages {
  min-height: 0;
  height: auto;
  overflow-y: auto;
  padding: 17px 16px 6px;
  scrollbar-width: thin;
}

.course-assistant-messages article {
  max-width: 89%;
  margin-bottom: 13px;
  padding: 12px 14px;
  border-radius: 13px;
}

.course-assistant-messages article strong { display: block; margin-bottom: 5px; font-size: 11px; }
.course-assistant-messages article p { margin: 0; white-space: pre-wrap; font-size: 13px; line-height: 1.75; }
.course-assistant-messages .is-assistant { border: 1px solid #e9e4d8; background: #fff; color: #252721; box-shadow: 0 5px 19px rgba(30,25,15,.05); }
.course-assistant-messages .is-assistant strong { color: #9b6c12; }
.course-assistant-messages .is-user { margin-left: auto; background: linear-gradient(135deg, #191a16, #2d2b23); color: #fff; }

.course-assistant-sources {
  max-width: 89%;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -6px 0 14px;
}

.course-assistant-sources a {
  padding: 5px 8px;
  border: 1px solid #dec993;
  border-radius: 999px;
  background: #fffaf0;
  color: #72500e;
  font-size: 10px;
  font-weight: 800;
}

.course-assistant-suggestions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 15px 10px;
}

.course-assistant-suggestions button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #d5bd87;
  border-radius: 999px;
  background: #fffaf0;
  color: #765214;
  font-size: 11px;
  cursor: pointer;
}

.course-assistant-panel form {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  margin: 0 14px;
  padding: 8px;
  border: 1px solid #d5d0c4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(25,24,19,.05);
}

.course-assistant-panel form textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #24251f;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.course-assistant-panel form button {
  align-self: end;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #efd06f, #bd8320);
  color: #111;
  font-size: 21px;
  font-weight: 900;
  cursor: pointer;
}

.course-assistant-panel form button:disabled { opacity: .48; cursor: wait; }
.course-assistant-status { display: block; padding: 9px 16px 13px; color: #777b75; font-size: 10px; line-height: 1.5; }
.course-assistant-upgrade { width: max-content; display: block; margin: -4px 0 14px; padding: 9px 13px; border-radius: 7px; background: #c9952d; color: #111; font-size: 12px; font-weight: 900; }

#courseAssistantIndexPane.is-active {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  background: #f6f4ee;
}

.course-index-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 17px 11px;
}

.course-index-intro div { display: grid; gap: 3px; }
.course-index-intro small { color: #ae7c1e; font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.course-index-intro strong { color: #191a16; font-size: 16px; }
.course-index-intro > span { color: #7e7b72; font-size: 10px; white-space: nowrap; }

.course-index-search {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  margin: 0 16px 11px;
  padding: 0 11px;
  border: 1px solid #d7d1c3;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(32,29,20,.04);
}

.course-index-search span { color: #ad7b1e; font-size: 20px; }
.course-index-search input { min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; color: #20211d; font-size: 13px; }

.course-index-topics {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: thin;
}

.course-index-topics button {
  flex: 0 0 auto;
  min-width: 46px;
  height: 29px;
  padding: 0 10px;
  border: 1px solid #ddd6c6;
  border-radius: 999px;
  background: #fff;
  color: #64625c;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.course-index-topics button.is-active { border-color: #c79225; background: #171813; color: #f1c657; }

.course-index-results {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  padding: 0 15px 16px;
  scrollbar-width: thin;
}

.course-index-results > a,
.course-index-results > button {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #e0dbcf;
  border-radius: 12px;
  background: #fff;
  color: #21221d;
  text-align: left;
  box-shadow: 0 4px 14px rgba(28,26,20,.035);
  cursor: pointer;
}

.course-index-results > a:hover,
.course-index-results > button:hover { border-color: #ca9a35; transform: translateY(-1px); box-shadow: 0 8px 23px rgba(36,30,17,.08); }
.course-index-results > a > i,
.course-index-results > button > i { color: #a8791d; font-size: 18px; font-style: normal; }

.course-index-result-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f3ead5;
  color: #9e6e13;
  font-size: 10px;
  font-weight: 900;
}

.course-index-result-badge.is-knowledge { background: #e8efff; color: #4164bd; }
.course-index-result-badge.is-current { background: #171813; color: #efc457; }
.course-index-result-copy { min-width: 0; display: grid; gap: 3px; }
.course-index-result-copy strong { overflow: hidden; color: #1f201b; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.course-index-result-copy small { overflow: hidden; color: #9d701b; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.course-index-result-copy em { overflow: hidden; color: #77766f; font-size: 10px; font-style: normal; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }

.course-index-loading,
.course-index-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #817e76;
  text-align: center;
}

.course-index-loading i {
  width: 30px;
  height: 30px;
  border: 2px solid #e6dcc4;
  border-top-color: #c28c24;
  border-radius: 50%;
  animation: ynq-index-load .8s linear infinite;
}

.course-index-empty b { color: #403f39; font-size: 14px; }
.course-index-empty span { font-size: 11px; }

@keyframes ynq-core-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

@keyframes ynq-orbit-spin {
  to { transform: rotateZ(360deg) rotateX(24deg); }
}

@keyframes ynq-visor-scan {
  0%, 28% { left: -35%; }
  68%, 100% { left: 115%; }
}

@keyframes ynq-eye-blink {
  0%, 43%, 49%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(.18); }
}

@keyframes ynq-signal {
  0%, 100% { opacity: .3; transform: scale(.72); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes ynq-nudge-in {
  from { opacity: 0; transform: translateY(9px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@keyframes ynq-core-talk {
  from { transform: translateZ(18px) translateY(0) rotate(-1deg); }
  to { transform: translateZ(18px) translateY(-2px) rotate(1deg); }
}

@keyframes ynq-panel-open {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes ynq-index-load { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .course-assistant-fab {
    right: 13px;
    bottom: 13px;
    width: 80px;
    height: 80px;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .course-assistant-fab::before,
  .course-assistant-fab-copy,
  .course-assistant-live { display: none !important; }
  .course-assistant-fab .ynq-knowledge-core { width: 76px; height: 76px; filter: drop-shadow(0 10px 14px rgba(21,32,68,.3)); }
  .course-assistant-nudge { right: 82px; bottom: 69px; width: min(224px, calc(100vw - 108px)); padding: 11px 13px; }
  .course-assistant-nudge span { font-size: 12px; }
  .course-assistant-panel { left: 10px; right: 10px; bottom: 86px; width: auto; height: min(680px, calc(100dvh - 104px)); border-radius: 17px; }
  .course-assistant-panel > .course-assistant-head { min-height: 78px; }
  .course-index-intro { align-items: flex-start; flex-direction: column; gap: 5px; }
  .course-index-results > a,
  .course-index-results > button { min-height: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  .ynq-knowledge-core,
  .ynq-core-orbit,
  .ynq-core-visor::after,
  .ynq-core-visor i,
  .course-assistant-fab.is-speaking .ynq-core-shell,
  .ynq-core-signal i,
  .course-assistant-panel.is-open { animation: none !important; }
  .course-assistant-fab,
  .course-index-results > a,
  .course-index-results > button { transition: none !important; }
}
