/* Minimal float entry — full chat.css loads only when the panel opens. */
.amz-aikb-ai-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.14em;
}

.amz-aikb-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amz-aikb-drawer-title > .amz-aikb-ai-icon {
  color: #c45c26;
  font-size: 20px;
}

.amz-aikb-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99990;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: #c45c26;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(31, 36, 48, 0.22);
  cursor: pointer;
  visibility: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.amz-aikb-float > .amz-aikb-ai-icon {
  font-size: 22px;
}

.amz-aikb-float.amz-aikb-ready {
  visibility: visible;
}

.amz-aikb-float--loading {
  opacity: 0.75;
  cursor: wait;
}

.rollbar .amz-aikb-roll-li {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  margin-bottom: 5px;
  text-align: center;
  border-radius: 6px;
  background: #c45c26;
}

.rollbar .amz-aikb-roll-li .amz-aikb-float,
.rollbar .amz-aikb-float-roll {
  position: static;
  width: 100%;
  height: auto;
  min-height: 40px;
  border-radius: 6px;
  box-shadow: none;
  background: transparent;
  visibility: visible;
}

.rollbar .amz-aikb-roll-li h6 {
  display: none;
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 8px 0 0;
  padding: 4px 8px;
  white-space: nowrap;
  background: #1f2430;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}

.rollbar .amz-aikb-roll-li:hover h6 {
  display: block;
}

@media (max-width: 860px) {
  .amz-aikb-float {
    right: 14px;
    bottom: 14px;
  }
}

/* Keep the lazy-loading shell dark from the first frame. */
body.night .amz-aikb-drawer.is-booting .amz-aikb-drawer-panel,
body.night .amz-aikb-drawer.is-booting.is-fullscreen {
  color-scheme: dark;
  background: #181a1f;
}

body.night .amz-aikb-drawer.is-booting .amz-aikb-drawer-head {
  border-color: #353a44;
  background: rgba(34, 37, 43, 0.96);
}

body.night .amz-aikb-drawer.is-booting .amz-aikb-drawer-title strong {
  color: #e8ebf0;
}

body.night .amz-aikb-boot-card {
  background: rgba(34, 37, 43, 0.97);
  border-color: #353a44;
  color: #e8ebf0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

body.night .amz-aikb-boot-hint {
  color: #a0a7b2;
}

/* 栏目搜索框下 AI 引导（首屏展示，不依赖 chat.css） */
.amz-aikb-search-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.amz-aikb-search-hint .amz-aikb-search-ask {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 6px;
  padding: 3px 14px;
  border: 0;
  border-radius: 30px;
  background: var(--amz-aikb-accent, #c45c26);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.amz-aikb-search-hint .amz-aikb-search-ask:hover {
  transform: translateY(-1px);
}

.amz-aikb-search-ask-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 0 14px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--amz-aikb-accent, #c45c26);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.amz-aikb-search-ask-mini:hover {
  opacity: 0.9;
}

/* Instant drawer shell before chat.css/js arrive */
html.amz-aikb-page-scroll-locked {
  /* The site skin reserves a desktop scrollbar gutter. A fullscreen shell
     must reclaim it from the first frame so its right edge reaches the viewport. */
  scrollbar-gutter: auto !important;
}

.amz-aikb-drawer.is-booting {
  position: fixed;
  inset: 0;
  z-index: 99991;
  background: rgba(20, 24, 32, 0.45);
  display: flex;
  justify-content: flex-end;
}

.amz-aikb-drawer.is-booting[hidden] {
  display: none !important;
}

.amz-aikb-drawer.is-booting .amz-aikb-drawer-panel {
  position: relative;
  width: min(960px, 100%);
  height: 100%;
  background: #f6f3ee;
  display: flex;
  flex-direction: column;
  padding: 12px;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
}

/* Match the final chat.css fullscreen geometry on the very first paint. */
.amz-aikb-drawer.is-booting.is-fullscreen {
  background: #f6f3ee;
}

.amz-aikb-drawer.is-booting.is-fullscreen .amz-aikb-drawer-panel {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  box-shadow: none;
  animation: none;
}

.amz-aikb-drawer.is-booting .amz-aikb-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.amz-aikb-drawer.is-booting .amz-aikb-drawer-title strong {
  font-size: 18px;
  font-weight: 800;
  color: #1f2430;
}

.amz-aikb-drawer.is-booting .amz-aikb-app {
  visibility: hidden;
  pointer-events: none;
  flex: 1;
  min-height: 0;
}

.amz-aikb-boot-overlay {
  position: absolute;
  inset: 52px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.amz-aikb-boot-overlay[hidden] {
  display: none !important;
}

.amz-aikb-boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 28px;
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid rgba(31, 36, 48, 0.08);
  box-shadow: 0 10px 30px rgba(31, 36, 48, 0.1);
  color: #1f2430;
  text-align: center;
}

.amz-aikb-boot-card p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.amz-aikb-boot-hint {
  font-size: 12px;
  color: #6b7280;
}

.amz-aikb-boot-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(196, 92, 38, 0.2);
  border-top-color: #c45c26;
  animation: amz-aikb-boot-spin 0.7s linear infinite;
}

@keyframes amz-aikb-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

.amz-aikb-drawer.is-booting .amz-aikb-drawer-fs,
.amz-aikb-drawer.is-booting .amz-aikb-sidebar-toggle {
  display: none;
}

@media (max-width: 860px) {
  .amz-aikb-drawer.is-booting .amz-aikb-drawer-panel {
    width: 100%;
  }
}
