/* FanliBot route */

.page-main.page-about-bot {
  width: 100%;
  max-width: none;
  padding-top: 0;
  padding-bottom: 0;
}

body[data-route="about"] #site-footer {
  display: none;
}

.fanlibot-page {
  min-height: calc(100vh - var(--header-height));
  padding: calc(var(--header-height) + 1rem) 0 7.4rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.fanlibot-toolbar {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  padding-bottom: 0.6rem;
}

.fanlibot-reset {
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 999px;
  padding: 0.54rem 0.86rem;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.fanlibot-stream {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 2rem;
  display: grid;
  align-content: start;
  gap: 2.2rem;
}

.fanlibot-message {
  display: flex;
  width: 100%;
}

.fanlibot-message.is-assistant {
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
}

.fanlibot-message.is-user {
  justify-content: flex-end;
  width: 100%;
  max-width: 100%;
}

.fanlibot-bubble {
  max-width: min(32rem, 100%);
  font-size: 1rem;
  line-height: 1.56;
  white-space: pre-wrap;
  word-break: break-word;
}

.fanlibot-message.is-assistant .fanlibot-bubble {
  width: 100%;
  max-width: none;
  color: var(--text);
}

.fanlibot-thinking {
  display: inline-block;
  color: transparent;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--text-soft) 42%, transparent) 0%,
    color-mix(in srgb, var(--text) 88%, transparent) 48%,
    color-mix(in srgb, var(--text-soft) 42%, transparent) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fanlibotThinkingSweep 1.25s linear infinite;
}

@keyframes fanlibotThinkingSweep {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -20% 0;
  }
}

.fanlibot-reasoning {
  display: block;
  width: 100%;
  margin-bottom: 0.8rem;
}

.fanlibot-reasoning summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-family: var(--font-meta);
  letter-spacing: 0.01em;
  list-style: none;
  transition: color var(--dur-fast) var(--ease-soft);
}

.fanlibot-reasoning summary::-webkit-details-marker {
  display: none;
}

.fanlibot-reasoning summary::before {
  content: ">";
  display: inline-block;
  transform: rotate(0deg);
  transition: transform var(--dur-fast) var(--ease-soft);
}

.fanlibot-reasoning.is-thinking summary {
  color: transparent;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--text-soft) 42%, transparent) 0%,
    color-mix(in srgb, var(--text) 88%, transparent) 48%,
    color-mix(in srgb, var(--text-soft) 42%, transparent) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fanlibotThinkingSweep 1.25s linear infinite;
}

.fanlibot-reasoning.is-thinking summary::before {
  color: var(--text-soft);
}

.fanlibot-reasoning[open] summary::before {
  transform: rotate(90deg);
}

.fanlibot-reasoning summary:hover,
.fanlibot-reasoning summary:focus-visible {
  color: var(--text);
  outline: none;
}

.fanlibot-reasoning-copy {
  display: none;
  opacity: 0;
  margin-top: 0;
  padding: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  transition:
    opacity var(--dur-mid) var(--ease-soft),
    margin-top var(--dur-mid) var(--ease-soft);
}

.fanlibot-reasoning[open] .fanlibot-reasoning-copy {
  display: block;
  opacity: 1;
  margin-top: 0.55rem;
}

.fanlibot-bubble.is-markdown p,
.fanlibot-bubble.is-markdown ul,
.fanlibot-bubble.is-markdown ol,
.fanlibot-bubble.is-markdown h1,
.fanlibot-bubble.is-markdown h2,
.fanlibot-bubble.is-markdown h3 {
  margin: 0;
}

.fanlibot-bubble.is-markdown {
  white-space: normal;
  line-height: 1.68;
}

.fanlibot-bubble.is-markdown p + p,
.fanlibot-bubble.is-markdown p + ul,
.fanlibot-bubble.is-markdown p + ol,
.fanlibot-bubble.is-markdown ul + p,
.fanlibot-bubble.is-markdown ol + p,
.fanlibot-bubble.is-markdown ul + ul,
.fanlibot-bubble.is-markdown ol + ol {
  margin-top: 0.52rem;
}

.fanlibot-bubble.is-markdown h1,
.fanlibot-bubble.is-markdown h2,
.fanlibot-bubble.is-markdown h3 {
  line-height: 1.22;
  font-weight: 700;
}

.fanlibot-bubble.is-markdown p + h1,
.fanlibot-bubble.is-markdown p + h2,
.fanlibot-bubble.is-markdown p + h3,
.fanlibot-bubble.is-markdown ul + h1,
.fanlibot-bubble.is-markdown ul + h2,
.fanlibot-bubble.is-markdown ul + h3,
.fanlibot-bubble.is-markdown ol + h1,
.fanlibot-bubble.is-markdown ol + h2,
.fanlibot-bubble.is-markdown ol + h3 {
  margin-top: 0.92rem;
}

.fanlibot-bubble.is-markdown h1 + p,
.fanlibot-bubble.is-markdown h1 + ul,
.fanlibot-bubble.is-markdown h1 + ol,
.fanlibot-bubble.is-markdown h2 + p,
.fanlibot-bubble.is-markdown h2 + ul,
.fanlibot-bubble.is-markdown h2 + ol,
.fanlibot-bubble.is-markdown h3 + p,
.fanlibot-bubble.is-markdown h3 + ul,
.fanlibot-bubble.is-markdown h3 + ol {
  margin-top: 0.4rem;
}

.fanlibot-bubble.is-markdown ul,
.fanlibot-bubble.is-markdown ol {
  padding-left: 1.3rem;
  list-style-position: outside;
}

.fanlibot-bubble.is-markdown ul {
  list-style-type: disc;
}

.fanlibot-bubble.is-markdown ol {
  list-style-type: decimal;
}

.fanlibot-bubble.is-markdown li + li {
  margin-top: 0.16rem;
}

.fanlibot-bubble.is-markdown code {
  border-radius: 8px;
  padding: 0.12rem 0.36rem;
  background: color-mix(in srgb, var(--surface-2) 96%, transparent);
  font-family: var(--font-meta);
  font-size: 0.9em;
}

.fanlibot-bubble.is-markdown a {
  color: var(--accent-strong);
}

.fanlibot-message.is-user .fanlibot-bubble {
  display: inline-flex;
  width: auto;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--surface-2) 94%, transparent);
  color: var(--text);
  max-width: min(28rem, 100%);
}

.fanlibot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: -0.8rem;
}

.fanlibot-suggestion {
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 999px;
  padding: 0.56rem 1rem;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.fanlibot-composer {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  width: min(980px, calc(100% - 2rem));
  display: grid;
  gap: 0.55rem;
}

.fanlibot-note {
  margin: 0;
  padding: 0.56rem 0.78rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  color: color-mix(in srgb, var(--text-soft) 94%, var(--line-strong) 6%);
  font-size: 0.76rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-wrap: wrap;
}

.fanlibot-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: end;
  border: 1px solid var(--btn-muted-line);
  border-radius: 24px;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
  background: var(--btn-muted-bg);
}

.fanlibot-input {
  width: 100%;
  min-height: 0;
  max-height: 8rem;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.45;
}

.fanlibot-input::placeholder {
  color: var(--text-soft);
}

.fanlibot-input:focus {
  outline: none;
}

.fanlibot-send {
  min-width: 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-text);
  font: inherit;
  font-size: 0;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.fanlibot-send[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
}

.fanlibot-send::before {
  content: "";
  width: 1.38rem;
  height: 1.38rem;
  display: block;
  margin: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17V7'/%3E%3Cpath d='M7.5 11.5L12 7l4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17V7'/%3E%3Cpath d='M7.5 11.5L12 7l4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
