/* 正文节卡沿用原样；引用是输入/历史的一层轻纸笺。 */
.reading-quote-selection[hidden], .reading-quote-draft[hidden] { display: none; }
.reading-quote-selection {
  position: fixed; z-index: 150; left: 50%; bottom: max(80px, env(safe-area-inset-bottom));
  transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 6px 14px;
  background: var(--ivory); border: 1px solid var(--border-soft); border-radius: 12px;
  box-shadow: 0 4px 18px rgba(24,24,26,.1); display: flex; align-items: center; gap: 8px;
}
/* 跟在划线末尾（2026-09-23 用户：比固定在屏幕底部自然）；定位由 reading-quote.js 按选区末行算。 */
.reading-quote-selection.is-anchored { bottom: auto; transform: none; }
.reading-quote-selection button { white-space: nowrap; color: var(--near-black); font-weight: 600; }
.reading-quote-selection span { font-size: 13px; }
.reading-quote-card { font-size: 14px; line-height: 1.6; color: var(--near-black); text-align: left; min-width: 0; }
.reading-quote-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--stone); }
.reading-quote-head > :first-child { min-width: 0; overflow-wrap: anywhere; }
.reading-quote-card blockquote {
  margin: 4px 0; padding: 0 0 0 12px; border-left: 2px solid var(--border-soft);
  white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.reading-quote-card button, .reading-quote-selection button, .reading-quote-prompts button, .reading-quote-dialog button {
  min-height: 44px; border: 0; background: transparent; font: inherit; cursor: pointer; color: var(--near-black); padding: 4px 8px;
}
.reading-quote-card > button { font-size: 12px; color: var(--stone); }
.reading-quote-card button:focus-visible, .reading-quote-selection button:focus-visible, .reading-quote-prompts button:focus-visible {
  outline: 2px solid var(--near-black); outline-offset: 2px;
}
.reading-quote-draft { padding: 8px 12px 4px; border-bottom: 1px solid var(--border-soft); background: var(--ivory); border-radius: 14px 14px 0 0; }
.reading-quote-prompts { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.reading-quote-prompts button { font-size: 12px; padding: 2px 6px; }
.reading-quote-budget { margin: 0; font-size: 12px; line-height: 1.5; color: var(--stone); }
.reading-quote-budget.is-over { color: var(--near-black); font-weight: 600; }
.ac-ask-bubble.is-question:has(.reading-quote-card) { max-width: 100%; background: var(--ivory); color: var(--near-black); border: 1px solid var(--border-soft); }
.ac-ask-bubble.is-question .reading-quote-card + p { margin-top: 12px; }
.reading-quote-dialog { width: min(520px, calc(100vw - 32px)); max-height: min(75dvh, 680px); padding: 24px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--ivory); color: var(--near-black); }
.reading-quote-dialog::backdrop { background: rgba(24,24,26,.4); }
.reading-quote-dialog h2 { margin: 0 0 16px; font-size: 20px; }
.reading-quote-dialog blockquote { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; max-height: 48dvh; overflow: auto; }
.reading-quote-highlight { position: fixed; inset: 0; pointer-events: none; z-index: 120; }
.reading-quote-highlight i { position: fixed; background: rgba(185,139,74,.24); border-radius: 2px; }
.reading-quote-notice { position: fixed; z-index: 151; left: 50%; bottom: 90px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--ivory); color: var(--near-black); font-size: 14px; }
@media (max-width: 520px) {
  .reading-quote-draft { padding: 4px 10px; }
  .reading-quote-draft .reading-quote-card blockquote { -webkit-line-clamp: 2; }
  .reading-quote-prompts { gap: 0 2px; }
  .reading-quote-prompts button { padding-inline: 2px; flex: 1 0 auto; white-space: nowrap; }
  .reading-quote-draft .reading-quote-head button { min-height: 36px; }
}

.reading-quote-price { display: block; font-size: 12px; line-height: 1.5; color: var(--stone); margin: 2px 0 4px; }
.ac-ask-composer-panel:has(.reading-quote-draft:not([hidden])) { max-height: 60dvh; overflow-y: auto; }

/* 划线续问：墨色小胶囊＋指向划线末尾的小尖角（2026-09-23 用户：原先白底大框「不精致」）。
   视觉 34px 高，点按区用 ::after 外扩补足 44px。 */
.reading-quote-selection {
  gap: 0; padding: 0 4px; min-height: 34px; border: 0; border-radius: 999px;
  background: var(--near-black); color: var(--ivory);
  box-shadow: 0 8px 24px rgba(24,24,26,.18), 0 1px 3px rgba(24,24,26,.14);
  animation: reading-quote-pop .16s ease-out;
}
.reading-quote-selection button {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px 0 12px; color: var(--ivory);
  font-size: 14px; font-weight: 500; letter-spacing: .04em;
}
.reading-quote-selection button::before {
  content: ""; display: block; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 2 12 12' fill='none' stroke='black' stroke-width='1.35' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M2.75 3.25h10.5v7.25H8.5l-3.25 2.5v-2.5h-2.5z'/%3E%3Cpath d='M5.5 6.25h5M5.5 8.25h3'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 2 12 12' fill='none' stroke='black' stroke-width='1.35' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M2.75 3.25h10.5v7.25H8.5l-3.25 2.5v-2.5h-2.5z'/%3E%3Cpath d='M5.5 6.25h5M5.5 8.25h3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.reading-quote-selection button::after { content: ""; position: absolute; inset: -5px -2px; }
.reading-quote-selection button:disabled { opacity: .55; cursor: default; }
.reading-quote-selection button:focus-visible { outline-color: var(--ivory); outline-offset: -3px; border-radius: 999px; }
.reading-quote-selection span:empty { display: none; }
.reading-quote-selection span { padding: 0 12px 0 2px; font-size: 13px; color: var(--ivory); opacity: .78; }
.reading-quote-selection.is-anchored::before {
  content: ""; position: absolute; top: -4px; left: var(--caret-x, 18px); width: 9px; height: 9px;
  background: var(--near-black); border-radius: 1.5px; transform: rotate(45deg);
}
.reading-quote-selection.is-anchored.is-above::before { top: auto; bottom: -4px; }
/* 触屏要给系统选区拖柄让出一行的距离，尖角隔着一行字就指不准了：触屏只留胶囊。 */
.reading-quote-selection.is-coarse::before { display: none; }
@keyframes reading-quote-pop { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; } }
.reading-quote-selection:not(.is-anchored) { animation: none; }
@media (prefers-reduced-motion: reduce) { .reading-quote-selection { animation: none; } }
