/* ==========================================================================
   智能助理 assistant.css
   --------------------------------------------------------------------------
   右下角悬浮球 + 毛玻璃搜索导航面板（紫雾玻璃风格）
   层级 9990/9991：低于积分弹窗(10000)、低于提示条(9999)，避免遮挡业务流程
   ========================================================================== */

/* ------------------------------ 悬浮球 ------------------------------ */
.jk-asst-launch {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9990;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(140deg, #a78bfa 0%, #7c5cff 55%, #6a46e8 100%);
  box-shadow: 0 14px 30px -10px rgba(106, 70, 232, .62), 0 3px 10px rgba(80, 50, 170, .22);
  transition: transform .22s cubic-bezier(.34, 1.5, .5, 1), box-shadow .22s ease;
  -webkit-tap-highlight-color: transparent;
}
.jk-asst-launch:hover { transform: translateY(-2px) scale(1.04); }
.jk-asst-launch:active { transform: scale(.95); }
.jk-asst-launch svg { width: 27px; height: 27px; }
.jk-asst-launch::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 26px;
  border: 2px solid rgba(124, 92, 255, .34);
  opacity: 0;
  animation: jkAsstPulse 3.4s ease-out infinite;
  pointer-events: none;
}
@keyframes jkAsstPulse {
  0%   { opacity: .75; transform: scale(.86); }
  70%  { opacity: 0;   transform: scale(1.16); }
  100% { opacity: 0;   transform: scale(1.16); }
}
.jk-asst-launch .jk-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ff6b81;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(255, 107, 129, .5);
}

/* 首次出现的引导气泡 */
.jk-asst-tip {
  position: fixed;
  right: 92px;
  bottom: 36px;
  z-index: 9990;
  max-width: 232px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #3b2b6b;
  border-radius: 14px 14px 4px 14px;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 10px 26px -12px rgba(80, 50, 170, .42);
  animation: jkAsstTipIn .28s ease-out;
}
.jk-asst-tip b { color: #6a46e8; font-weight: 700; }
.jk-asst-tip .jk-tip-x {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: none;
  color: #a99fd0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 3px 5px;
}
@keyframes jkAsstTipIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 面板 ------------------------------ */
.jk-asst-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 9991;
  width: 424px;
  max-width: calc(100vw - 32px);
  height: 596px;
  max-height: calc(100vh - 130px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  color: #241a45;
  background: rgba(255, 255, 255, .74);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .86);
  box-shadow: 0 30px 70px -22px rgba(76, 45, 165, .5), 0 4px 14px rgba(80, 50, 170, .12);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  animation: jkAsstIn .22s cubic-bezier(.2, .9, .3, 1.1);
}
.jk-asst-panel.open { display: flex; }
@keyframes jkAsstIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* 顶部 */
.jk-asst-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(124, 92, 255, .12);
}
.jk-asst-logo {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(140deg, #a78bfa, #7c5cff 60%, #6a46e8);
  box-shadow: 0 6px 14px -6px rgba(106, 70, 232, .7);
}
.jk-asst-logo svg { width: 19px; height: 19px; }
.jk-asst-htxt { flex: 1; min-width: 0; }
.jk-asst-htxt b { display: block; font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.jk-asst-htxt span { display: block; font-size: 11.5px; color: #8577a8; margin-top: 1px; }
.jk-asst-coin {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #5b2fb8;
  background: rgba(124, 92, 255, .13);
  transition: background .16s ease;
}
.jk-asst-coin:hover { background: rgba(124, 92, 255, .22); }
.jk-asst-coin b { font-size: 14px; }
.jk-asst-x {
  flex: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: #8577a8;
  background: rgba(124, 92, 255, .08);
}
.jk-asst-x:hover { background: rgba(124, 92, 255, .18); color: #5b2fb8; }

/* 搜索框 */
.jk-asst-search {
  position: relative;
  padding: 12px 16px 8px;
}
.jk-asst-search > svg {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-40%);
  width: 17px;
  height: 17px;
  color: #a08fd0;
  pointer-events: none;
}
.jk-asst-input {
  width: 100%;
  height: 44px;
  padding: 0 76px 0 40px;
  font-size: 14.5px;
  color: #241a45;
  border-radius: 14px;
  border: 1.5px solid rgba(124, 92, 255, .2);
  background: rgba(255, 255, 255, .82);
  outline: none;
  font-family: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.jk-asst-input::placeholder { color: #a99fd0; }
.jk-asst-input:focus {
  border-color: rgba(124, 92, 255, .58);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, .13);
}
.jk-asst-kbd {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-40%);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.jk-asst-kbd i {
  font-style: normal;
  font-size: 10.5px;
  color: #a08fd0;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(124, 92, 255, .1);
  border: 1px solid rgba(124, 92, 255, .16);
}
.jk-asst-clear {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-40%);
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: #b7a8e8;
}
.jk-asst-clear.show { display: flex; }

/* ---------- 左侧栏 dock：分类导航（接管原站死掉的面板） ---------- */
.jk-dock {
  margin-top: 60px; height: calc(100dvh - 60px); overflow: auto;
  padding: 12px 10px; display: flex; flex-direction: column; gap: 2px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-right: 1px solid rgba(124, 92, 255, .16);
}
.jk-dock-head { display: flex; align-items: center; gap: 6px; padding: 2px 8px 10px; }
.jk-dock-head b { font-size: 13.5px; color: #241a45; }
.jk-dock-head span { font-size: 11px; color: #8b7fb8; flex: 1; }
.jk-dock-x {
  width: 28px; height: 28px; border: 0; border-radius: 9px; flex: none;
  background: rgba(124, 92, 255, .12); color: #5b4a9e; cursor: pointer;
  display: grid; place-items: center; transition: background .15s;
}
.jk-dock-x:hover { background: rgba(124, 92, 255, .24); }
.jk-dock-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 9px; border: 0; border-radius: 12px; background: transparent;
  cursor: pointer; font: inherit; text-align: left; color: #241a45;
  transition: background .15s;
}
.jk-dock-item:hover { background: rgba(124, 92, 255, .10); }
.jk-dock-ico {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: #fff;
}
.jk-dock-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jk-dock-n { font-size: 11px; color: #8b7fb8; font-weight: 600; }
.jk-dock-home { margin-top: 8px; border-top: 1px solid rgba(124, 92, 255, .14); border-radius: 0 0 14px 14px; padding-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .jk-dock-item, .jk-dock-x { transition: none; }
}
/* 有输入内容时隐藏快捷键提示，避免与清空按钮重叠 */
.jk-asst-panel.has-q .jk-asst-kbd { display: none; }
.jk-asst-panel.has-q .jk-asst-input { padding-right: 52px; }

/* 分类条 */
.jk-asst-chips {
  display: flex;
  gap: 6px;
  padding: 2px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.jk-asst-chips::-webkit-scrollbar { display: none; }
.jk-asst-chip {
  flex: none;
  padding: 6px 12px;
  font-size: 12.5px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  color: #564a7d;
  background: rgba(124, 92, 255, .09);
  font-family: inherit;
  transition: all .16s ease;
}
.jk-asst-chip:hover { background: rgba(124, 92, 255, .18); }
.jk-asst-chip.on {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #a78bfa, #7c5cff);
  box-shadow: 0 5px 12px -5px rgba(106, 70, 232, .72);
}

/* 内容区 */
.jk-asst-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 8px 12px;
}
.jk-asst-body::-webkit-scrollbar { width: 7px; }
.jk-asst-body::-webkit-scrollbar-thumb { background: rgba(124, 92, 255, .26); border-radius: 8px; }

/* 需求理解回显 */
.jk-asst-parse {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 6px 10px 2px;
  padding: 8px 12px;
  font-size: 12px;
  color: #564a7d;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(167, 139, 250, .18), rgba(124, 92, 255, .1));
  border: 1px solid rgba(124, 92, 255, .2);
}
.jk-asst-parse b { color: #5b2fb8; font-size: 13px; font-weight: 700; }
.jk-asst-parse span { margin-left: auto; font-size: 10.5px; color: #a08fd0; white-space: nowrap; }

/* 空状态里的分类推荐 */
.jk-asst-sug {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 2px 16px 14px;
}

.jk-asst-sec {
  padding: 10px 10px 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .6px;
  color: #a08fd0;
}

/* 工具/命令条目 */
.jk-asst-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  background: none;
  font-family: inherit;
  color: inherit;
  transition: background .13s ease;
}
.jk-asst-item:hover, .jk-asst-item.sel { background: rgba(124, 92, 255, .12); }
.jk-asst-item.sel { box-shadow: inset 0 0 0 1.5px rgba(124, 92, 255, .38); }
.jk-asst-ic {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #fff;
  box-shadow: 0 5px 12px -6px rgba(60, 40, 130, .55);
}
.jk-asst-ic svg { width: 17px; height: 17px; }
.jk-asst-itxt { flex: 1; min-width: 0; }
.jk-asst-itxt b {
  display: block;
  font-size: 13.8px;
  font-weight: 600;
  color: #2c2050;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jk-asst-itxt span {
  display: block;
  font-size: 11.8px;
  color: #8577a8;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jk-asst-itxt mark {
  background: rgba(124, 92, 255, .2);
  color: #5b2fb8;
  border-radius: 3px;
  padding: 0 1px;
}
.jk-asst-cost {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  color: #6a46e8;
  background: rgba(124, 92, 255, .14);
  white-space: nowrap;
}
.jk-asst-cost.free { color: #0f9d58; background: rgba(16, 185, 129, .15); }
.jk-asst-cost.ai { color: #c2410c; background: rgba(249, 115, 22, .16); }
.jk-asst-cost.low { color: #b45309; background: rgba(251, 191, 36, .2); }
.jk-asst-cur { font-size: 10px; color: #7c5cff; font-weight: 700; flex: none; }

/* 快捷命令网格 */
.jk-asst-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 8px 8px;
}
.jk-asst-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #2c2050;
  background: rgba(255, 255, 255, .66);
  border: 1px solid rgba(124, 92, 255, .14);
  transition: all .16s ease;
}
.jk-asst-card:hover {
  background: rgba(255, 255, 255, .95);
  border-color: rgba(124, 92, 255, .36);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -12px rgba(80, 50, 170, .5);
}
.jk-asst-card .jk-asst-ic { width: 30px; height: 30px; border-radius: 10px; }
.jk-asst-card .jk-asst-ic svg { width: 15px; height: 15px; }

/* 空状态 / 帮助 */
.jk-asst-empty {
  padding: 26px 18px;
  text-align: center;
  color: #8577a8;
  font-size: 13px;
  line-height: 1.7;
}
.jk-asst-empty b { display: block; color: #564a7d; font-size: 14px; margin-bottom: 4px; }
.jk-asst-help {
  padding: 6px 14px 10px;
  font-size: 12.5px;
  line-height: 1.9;
  color: #564a7d;
}
.jk-asst-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(124, 92, 255, .13);
  color: #5b2fb8;
}

/* 底部 */
.jk-asst-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  font-size: 11.5px;
  color: #a08fd0;
  border-top: 1px solid rgba(124, 92, 255, .12);
  background: rgba(255, 255, 255, .42);
}
.jk-asst-foot span { display: inline-flex; align-items: center; gap: 4px; }
.jk-asst-foot i {
  font-style: normal;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(124, 92, 255, .11);
  color: #7c5cff;
  font-weight: 600;
}
.jk-asst-foot .jk-asst-more { margin-left: auto; border: 0; background: none; color: #7c5cff; cursor: pointer; font-size: 11.5px; font-family: inherit; }

/* ------------------------------ 移动端 ------------------------------ */
@media (max-width: 640px) {
  .jk-asst-launch { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .jk-asst-tip { display: none; }
  .jk-asst-kbd { display: none; }
  .jk-asst-input { padding-right: 44px; font-size: 16px; }
  .jk-asst-panel.has-q .jk-asst-input { padding-right: 44px; }
  .jk-asst-chips { padding-bottom: 12px; }
  .jk-asst-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    height: 82vh;
    max-height: 82vh;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jk-asst-launch::after { animation: none; }
  .jk-asst-panel, .jk-asst-tip { animation: none; }
}
