/* 科创智析 v1.5.3 · 全局数学深度学习入口 */

.layout-v15 .header-search { overflow: visible; }
.global-search-trigger { cursor: pointer; transition: .18s ease; }
.global-search-trigger:hover,
.global-search-trigger:focus-visible { color: #f1cf85; transform: scale(1.06); outline: 0; }

.global-search-suggestions {
  position: absolute;
  top: calc(100% + 11px);
  left: 0;
  z-index: 140;
  width: min(720px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 100px));
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(196, 178, 143, .74);
  border-radius: 17px;
  color: var(--v15-ink);
  background: rgba(255, 254, 250, .985);
  box-shadow: 0 24px 60px rgba(24, 38, 31, .2);
  backdrop-filter: blur(22px);
}
.global-search-suggestions[hidden] { display: none; }
.global-search-suggestions > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 3px 4px 10px; }
.global-search-suggestions > header div { display: grid; gap: 2px; }
.global-search-suggestions > header b { font: 700 12px var(--serif); }
.global-search-suggestions > header small { color: var(--v15-muted); font-size: 9px; }
.global-search-suggestions > header > span { color: var(--v15-gold); font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.global-suggestion-list { display: grid; gap: 4px; }
.global-suggestion-list button,
.global-ai-search-action { width: 100%; display: grid; align-items: center; border: 0; text-align: left; }
.global-suggestion-list button { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; padding: 9px 10px; border-radius: 11px; color: var(--v15-ink-2); background: transparent; }
.global-suggestion-list button:hover { background: #f4f0e7; }
.global-suggestion-list button > span { color: var(--v15-red); font-size: 8px; font-weight: 800; }
.global-suggestion-list button div { min-width: 0; display: grid; gap: 2px; }
.global-suggestion-list button b,
.global-suggestion-list button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-suggestion-list button b { font-size: 10px; }
.global-suggestion-list button small { color: var(--v15-muted); font-size: 8px; }
.global-ai-search-action { grid-template-columns: 38px minmax(0, 1fr) 24px; gap: 10px; margin-top: 8px; padding: 12px; border-radius: 13px; color: #fff8e9; background: linear-gradient(112deg, #80342e, #a94c3f); box-shadow: 0 10px 24px rgba(115, 43, 36, .18); }
.global-ai-search-action > span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; font: 800 11px var(--serif); }
.global-ai-search-action div { display: grid; gap: 2px; }
.global-ai-search-action b { font-size: 11px; }
.global-ai-search-action small { color: rgba(255,255,255,.7); font-size: 8px; }
.global-ai-search-action i { font-style: normal; font-size: 18px; }

.detail-modal-card:has(.global-search-shell) { width: min(1100px, 94vw); max-height: 92vh; }
.detail-modal-card:has(.global-search-shell) .modal-body { padding: 0; background: #f6f2e9; }
.global-search-shell { display: grid; gap: 14px; padding: 18px; }
.global-lesson-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid #ddd4c4; border-radius: 13px; background: #fffefa; }
.global-lesson-toolbar div { display: grid; gap: 2px; }
.global-lesson-toolbar span { color: var(--v15-red); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.global-lesson-toolbar b { font-size: 11px; }
.global-lesson-toolbar em { color: var(--v15-gold); font-size: 8px; font-style: normal; }
.global-evidence-panel { padding: 14px; border: 1px solid #e2dacb; border-radius: 15px; background: rgba(255,254,250,.82); }
.global-evidence-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.global-evidence-panel > header b { font-size: 11px; }
.global-evidence-panel > header small { color: var(--v15-muted); font-size: 8px; }
.global-local-hits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.global-local-hits article { min-width: 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; padding: 9px 10px; border: 1px solid #ece5d9; border-radius: 11px; background: #fff; }
.global-local-hits article > span { color: var(--v15-jade); font-size: 8px; font-weight: 800; }
.global-local-hits article div { min-width: 0; display: grid; gap: 2px; }
.global-local-hits article b,
.global-local-hits article small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-local-hits article b { font-size: 9px; }
.global-local-hits article small { color: var(--v15-muted); font-size: 8px; }
.global-local-empty { display: grid; gap: 3px; padding: 12px; border-radius: 11px; color: var(--v15-ink-2); background: #f2eee5; }
.global-local-empty b { font-size: 10px; }
.global-local-empty span { color: var(--v15-muted); font-size: 8px; }

.global-search-loading { min-height: 190px; display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 24px; padding: 26px; border-radius: 17px; color: #fff8e8; background: linear-gradient(125deg, #1f3a30, #162b24); }
.global-search-loading h3 { margin: 0 0 8px; font: 700 20px var(--serif); }
.global-search-loading p { max-width: 620px; margin: 0; color: #b8c8be; font-size: 10px; line-height: 1.75; }
.global-orbit { position: relative; width: 86px; height: 86px; display: grid; place-items: center; }
.global-orbit::before,
.global-orbit::after,
.global-orbit i { position: absolute; inset: 7px; border: 1px solid rgba(221,183,102,.34); border-radius: 50%; content: ""; animation: global-spin 3.8s linear infinite; }
.global-orbit::after { inset: 18px; border-color: rgba(255,255,255,.2); animation-direction: reverse; }
.global-orbit i:nth-child(2) { inset: 0 23px; }
.global-orbit i:nth-child(3) { inset: 23px 0; animation-duration: 2.8s; }
.global-orbit b { color: #e6c373; font: 700 24px var(--serif); }
.global-loading-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.global-loading-steps span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.11); border-radius: 999px; color: #dfc98f; font-size: 8px; }
@keyframes global-spin { to { transform: rotate(360deg); } }

.global-ai-lesson { overflow: hidden; border: 1px solid #dcd2c1; border-radius: 17px; background: #fffefa; box-shadow: 0 12px 32px rgba(42,48,41,.055); }
.global-ai-lesson > header { display: flex; align-items: center; gap: 10px; padding: 13px 17px; border-bottom: 1px solid #ebe4d8; background: linear-gradient(90deg, #f7f1e5, #fffefa); }
.global-ai-lesson > header > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--v15-jade); font: 800 10px var(--serif); }
.global-ai-lesson > header div { display: grid; gap: 2px; }
.global-ai-lesson > header b { font-size: 11px; }
.global-ai-lesson > header small { color: var(--v15-muted); font-size: 8px; }
.global-ai-answer { padding: 20px 24px 28px; color: #25372e; font-size: 12px; line-height: 1.9; }
.global-ai-answer h2 { margin: 24px 0 10px; padding-left: 11px; border-left: 3px solid var(--v15-red); color: #1b2d24; font: 700 17px var(--serif); }
.global-ai-answer h2:first-child { margin-top: 0; }
.global-ai-answer h3 { color: var(--v15-jade); font-size: 13px; }
.global-ai-answer pre,
.global-ai-answer code { border-radius: 8px; background: #f1ede4; }

.global-followup-panel { padding: 17px; border: 1px solid #dcd3c4; border-radius: 17px; background: #fffefa; }
.global-followup-panel > header div { display: grid; gap: 3px; }
.global-followup-panel > header b { font: 700 15px var(--serif); }
.global-followup-panel > header small { color: var(--v15-muted); font-size: 8px; }
.global-followup-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0; }
.global-followup-chips button { padding: 7px 10px; border: 1px solid #ddd3c2; border-radius: 999px; color: var(--v15-jade-dark); background: #f7f3eb; font-size: 9px; }
.global-followup-chips button:hover { border-color: #b89a60; background: #fff; }
.global-followup-thread { display: grid; gap: 9px; margin-bottom: 11px; }
.global-followup-message { max-width: 88%; padding: 11px 13px; border-radius: 13px; }
.global-followup-message > span { display: block; margin-bottom: 5px; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.global-followup-message.user { justify-self: end; color: #fff; background: var(--v15-jade); }
.global-followup-message.assistant { justify-self: start; border: 1px solid #e2d9c9; background: #f7f3eb; }
.global-followup-message p { margin: 0; line-height: 1.7; }
.global-followup-message.loading { color: var(--v15-muted); animation: global-pulse 1.2s ease-in-out infinite; }
@keyframes global-pulse { 50% { opacity: .55; } }
.global-followup-composer { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 9px; }
.global-followup-composer textarea { width: 100%; resize: vertical; padding: 11px 12px; border: 1px solid #ddd5c7; border-radius: 11px; outline: 0; color: var(--v15-ink); background: #fff; font: 10px/1.65 var(--sans); }
.global-followup-composer textarea:focus { border-color: #ad8850; box-shadow: 0 0 0 3px rgba(165,123,56,.09); }
.global-followup-composer button { border: 0; border-radius: 11px; color: #fff8e9; background: var(--v15-red); font-size: 10px; font-weight: 760; }
.global-followup-composer button span { display: block; margin-top: 2px; color: rgba(255,255,255,.6); font-size: 7px; font-weight: 500; }
.global-search-error { display: grid; gap: 6px; padding: 20px; border: 1px solid #e0c8c0; border-radius: 15px; color: #62332d; background: #faeeea; }
.global-search-error b { font: 700 16px var(--serif); }
.global-search-error p { margin: 0; }
.global-search-error span { font-size: 9px; }

@media (max-width: 760px) {
  .global-search-suggestions { position: fixed; top: 108px; left: 12px; right: 12px; width: auto; }
  .global-local-hits { grid-template-columns: 1fr; }
  .global-search-loading { grid-template-columns: 1fr; text-align: center; }
  .global-orbit { margin: 0 auto; }
  .global-loading-steps { justify-content: center; }
  .global-lesson-toolbar { align-items: flex-start; flex-direction: column; }
  .global-ai-answer { padding: 17px; }
  .global-followup-composer { grid-template-columns: 1fr; }
  .global-followup-composer button { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .global-orbit::before,
  .global-orbit::after,
  .global-orbit i,
  .global-followup-message.loading { animation: none; }
}
