/* Sensec 抗癌 AI 助手：站点内嵌组件（独立样式，不改站点原有 CSS） */
:root {
  --asst-bg: #f4f6f8;
  --asst-surface: #ffffff;
  --asst-line: #dce3e9;
  --asst-text: #0f1b26;
  --asst-muted: #6b7c8a;
  --asst-teal: #0d7a6f;
  --asst-teal-d: #0a5d55;
  --asst-teal-s: #e2f2ef;
  --asst-amber: #96590a;
  --asst-amber-s: #fdf2de;
  --asst-red: #b3261e;
  --asst-red-s: #fceceb;
  --asst-r: 10px;
  --asst-sh: 0 4px 16px rgba(15, 27, 38, .12);
}

.asst-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--asst-teal);
  color: #fff;
  font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(13, 122, 111, .32);
}
.asst-fab:hover { background: var(--asst-teal-d); }
.asst-fab .asst-fab-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #7ee0d3; box-shadow: 0 0 0 3px rgba(126, 224, 211, .25);
}

.asst-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 410px;
  max-width: 100%;
  background: var(--asst-bg);
  border-left: 1px solid var(--asst-line);
  box-shadow: var(--asst-sh);
  z-index: 950;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--asst-text);
}
.asst-panel.open { transform: translateX(0); }
.asst-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: var(--asst-surface);
  border-bottom: 1px solid var(--asst-line);
}
.asst-head h2 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.asst-head .asst-ver { font-size: 11px; color: var(--asst-muted); }
.asst-icon-btn {
  border: 1px solid var(--asst-line); background: var(--asst-surface);
  color: var(--asst-muted); border-radius: 8px; width: 30px; height: 30px;
  cursor: pointer; font-size: 15px; line-height: 1;
}
.asst-icon-btn:hover { color: var(--asst-text); border-color: var(--asst-teal); }

.asst-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.asst-msg { border-radius: var(--asst-r); padding: 10px 12px; max-width: 100%; word-break: break-word; }
.asst-msg.user { background: var(--asst-teal); color: #fff; align-self: flex-end; max-width: 92%; }
.asst-msg.bot { background: var(--asst-surface); border: 1px solid var(--asst-line); }
.asst-msg .asst-sec { font-weight: 700; color: var(--asst-teal-d); margin: 8px 0 2px; }
.asst-msg .asst-sec:first-child { margin-top: 0; }
.asst-msg ul { margin: 4px 0; padding-left: 18px; }
.asst-msg li { margin: 2px 0; }
.asst-msg a { color: var(--asst-teal-d); }
.asst-steps {
  margin-top: 8px; border-top: 1px dashed var(--asst-line); padding-top: 6px;
  font-size: 11.5px; color: var(--asst-muted);
}
.asst-steps .asst-step { display: inline-block; margin: 2px 6px 2px 0; }
.asst-steps .asst-ok { color: var(--asst-teal); }
.asst-steps .asst-warn { color: var(--asst-amber); }
.asst-note { margin-top: 8px; font-size: 11.5px; color: var(--asst-muted); border-top: 1px dashed var(--asst-line); padding-top: 6px; }
.asst-src { margin-top: 8px; font-size: 12px; }
.asst-src a { display: block; color: var(--asst-teal-d); text-decoration: none; }
.asst-src a:hover { text-decoration: underline; }
.asst-badge {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--asst-teal-s); color: var(--asst-teal-d); margin-right: 6px;
}
.asst-badge.warn { background: var(--asst-amber-s); color: var(--asst-amber); }
.asst-badge.danger { background: var(--asst-red-s); color: var(--asst-red); }

.asst-form { border-top: 1px solid var(--asst-line); background: var(--asst-surface); padding: 10px 12px 12px; }
.asst-input-row { display: flex; gap: 8px; align-items: flex-end; }
.asst-input {
  flex: 1; resize: none; min-height: 44px; max-height: 140px;
  border: 1px solid var(--asst-line); border-radius: var(--asst-r);
  padding: 10px 11px; font: inherit; color: inherit; background: var(--asst-bg);
}
.asst-input:focus { outline: 2px solid var(--asst-teal-s); border-color: var(--asst-teal); }
.asst-send {
  border: 0; border-radius: var(--asst-r); background: var(--asst-teal); color: #fff;
  padding: 11px 15px; font: 600 14px/1 inherit; cursor: pointer; height: 44px;
}
.asst-send:disabled { background: var(--asst-muted); cursor: not-allowed; }
.asst-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.asst-suggest button {
  border: 1px solid var(--asst-line); background: var(--asst-bg); color: var(--asst-muted);
  border-radius: 999px; padding: 5px 10px; font: 12px/1 inherit; cursor: pointer;
}
.asst-suggest button:hover { border-color: var(--asst-teal); color: var(--asst-teal-d); }
.asst-disclaimer { font-size: 11px; color: var(--asst-muted); margin-top: 8px; }
.asst-empty { color: var(--asst-muted); font-size: 13px; }

/* ================= 首页内嵌模式（主入口） ================= */
.asst-inline {
  display: flex;
  flex-direction: column;
  background: var(--asst-surface);
  border: 1px solid var(--asst-line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 27, 38, .10);
  overflow: hidden;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--asst-text);
}
.asst-inline-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #f2f9f8, #ffffff);
  border-bottom: 1px solid var(--asst-line);
}
.asst-inline-head strong { font-size: 15px; font-weight: 700; }
.asst-inline-head .asst-ver { font-size: 11px; color: var(--asst-muted); }
.asst-inline-head .asst-icon-btn { margin-left: auto; width: auto; padding: 0 10px; height: 28px; font-size: 12px; }
.asst-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--asst-teal-d);
  background: var(--asst-teal-s); border-radius: 999px; padding: 2px 8px;
}
.asst-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #17b89f; box-shadow: 0 0 0 3px rgba(23, 184, 159, .18);
}
.asst-inline .asst-log {
  min-height: 150px;
  max-height: 340px;
  border: 0;
  background: var(--asst-bg);
}
.asst-inline .asst-form { border-top: 1px solid var(--asst-line); }
.asst-inline .asst-input { background: #fff; font-size: 15px; }
.asst-inline .asst-send { font-size: 15px; padding: 0 18px; }
.asst-inline .asst-disclaimer { font-size: 11px; line-height: 1.55; }
.asst-pending { color: var(--asst-muted); font-style: normal; }

@media (max-width: 820px) {
  .asst-inline { border-radius: 14px; }
  .asst-inline-head { padding: 10px 12px 8px; flex-wrap: wrap; }
  .asst-inline-head strong { font-size: 14.5px; }
  .asst-inline .asst-log { min-height: 120px; max-height: 46vh; padding: 12px; }
  .asst-inline .asst-form { padding: 10px; }
  .asst-inline .asst-suggest {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .asst-inline .asst-suggest::-webkit-scrollbar { display: none; }
  .asst-inline .asst-suggest button { white-space: nowrap; flex: 0 0 auto; min-height: 34px; }
  .asst-inline .asst-input { font-size: 16px; min-height: 46px; }
  .asst-inline .asst-send { min-height: 46px; }
}

@media (max-width: 900px) {
  .asst-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; height: 78vh;
    border-left: 0; border-top: 1px solid var(--asst-line);
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
  }
  .asst-panel.open { transform: translateY(0); }
  .asst-fab { bottom: 16px; right: 16px; padding: 11px 14px; }
}
