/* 吴时全站浮层 · 纸白 / 墨黑 / 朱红 — 默认克制，展开再完整 */
:root {
  --ws-paper: #F4F3ED;
  --ws-ink: #20221F;
  --ws-muted: #62665E;
  --ws-red: #D83D23;
  --ws-line: #D7D8CF;
  --ws-z: 99990;
}
#wushiRoot, aside[aria-label="吴时"] {
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ws-ink);
}
/* 默认：半透明朱红小点，不挡主 CTA；展开卡片时仍可用大 FAB */
.wushi-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--ws-z);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid rgba(32,34,31,0.55);
  background: rgba(216, 61, 35, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: grab;
  box-shadow: 0 8px 22px rgba(32, 34, 31, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, width 0.15s ease, height 0.15s ease, border-radius 0.15s ease, opacity 0.15s ease;
  opacity: 0.92;
}
.wushi-fab:hover {
  transform: translateY(-1px);
  opacity: 1;
  box-shadow: 0 12px 28px rgba(216, 61, 35, 0.28);
}
.wushi-fab:active { cursor: grabbing; }
.wushi-fab.is-dragging { transition: none; }
.wushi-fab.is-open {
  width: 56px;
  height: 56px;
  border-radius: 3px;
  border-width: 2px;
  font-size: 14px;
  opacity: 1;
  box-shadow: 0 12px 32px rgba(216, 61, 35, 0.32), 0 0 0 3px rgba(244, 243, 237, 0.75);
}
.wushi-fab .ws-fab-pulse {
  position: absolute; inset: -5px; border: 1.5px solid rgba(216,61,35,0.55); border-radius: inherit;
  opacity: 0.35; animation: wsPulse 2.4s ease-out infinite; pointer-events: none;
}
.wushi-fab.is-open .ws-fab-pulse { inset: -6px; border-radius: 4px; }
@keyframes wsPulse {
  0% { transform: scale(1); opacity: 0.45; }
  70% { transform: scale(1.16); opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wushi-fab .ws-fab-pulse { animation: none; }
  .wushi-fab { transition: none; }
}
@media (max-width: 640px) {
  .wushi-fab {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: 40px;
    height: 40px;
    font-size: 11px;
  }
  .wushi-fab.is-open { width: 48px; height: 48px; }
  .wushi-card {
    right: 10px !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    width: min(100vw - 20px, 380px) !important;
    max-height: min(70vh, 520px) !important;
  }
}
.wushi-card {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: calc(var(--ws-z) + 1);
  width: min(360px, calc(100vw - 24px));
  background: var(--ws-paper);
  border: 1px solid var(--ws-line);
  border-radius: 3px;
  padding: 0;
  box-shadow: 0 20px 56px rgba(32, 34, 31, 0.16);
  display: flex;
  flex-direction: column;
  max-height: min(540px, calc(100vh - 100px));
  overflow: hidden;
}
.wushi-card.hidden, .wushi-card[hidden] { display: none !important; }
.wushi-card.is-minimized { display: none !important; }
.wushi-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--ws-line);
  cursor: grab; user-select: none; touch-action: none; background: #fff;
}
.wushi-head:active { cursor: grabbing; }
.wushi-title { font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }
.wushi-title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; background: var(--ws-red);
  margin-right: 8px; vertical-align: middle; border-radius: 1px;
}
.wushi-sub { font-size: 12px; color: var(--ws-muted); margin-top: 4px; }
.wushi-head-actions { display: flex; gap: 6px; flex-shrink: 0; }
.wushi-head-actions button, .wushi-actions button, .wushi-ask button {
  height: 30px; padding: 0 10px; border: 1px solid var(--ws-line); background: var(--ws-paper);
  color: var(--ws-ink); border-radius: 2px; font-size: 12px; cursor: pointer;
}
.wushi-head-actions button:hover, .wushi-actions button:hover, .wushi-ask button:hover {
  border-color: var(--ws-ink);
}
.wushi-btn-solid { background: var(--ws-red) !important; border-color: var(--ws-red) !important; color: #fff !important; }
.wushi-body { padding: 12px 14px 14px; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.wushi-levels { display: flex; gap: 6px; height: 6px; margin-bottom: 10px; }
.wushi-levels span {
  flex: 1; border-radius: 99px; background: rgba(216,61,35,0.15); position: relative; overflow: hidden;
}
.wushi-levels span::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--lvl, 0%);
  background: var(--ws-red); transition: width .08s linear;
}
.wushi-log {
  flex: 1; min-height: 140px; max-height: 220px; overflow: auto;
  border: 1px solid var(--ws-line); border-radius: 2px; padding: 10px;
  font-size: 12px; line-height: 1.55; background: #fff; margin-bottom: 10px;
}
.wushi-log .you { color: var(--ws-ink); }
.wushi-log .bot { color: var(--ws-ink); line-height: 1.55; white-space: pre-wrap; }
.wushi-log .bot strong, .wushi-log .bot em, .wushi-log .bot .hl { color: var(--ws-red); font-style: normal; font-weight: 600; }
.wushi-log .sys { color: var(--ws-muted); font-size: 12px; }
.wushi-link-card {
  display: inline-block; margin: 4px 6px 4px 0; padding: 6px 10px;
  border: 1px solid var(--ws-line); border-radius: 2px; background: #fff;
  color: var(--ws-red) !important; text-decoration: none; font-size: 12px;
  max-width: 100%; overflow-wrap: anywhere; word-break: break-all;
}
.wushi-link-card:hover { border-color: var(--ws-red); background: #fff8f6; }
.wushi-log .has-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.wushi-actions, .wushi-ask { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.wushi-actions #wushiWakeOpt[aria-pressed="true"] { border-color: var(--ws-red); color: var(--ws-red); }
.wushi-ask input {
  flex: 1; background: #fff; border: 1px solid var(--ws-line); border-radius: 2px;
  padding: 8px 12px; font-size: 13px; color: var(--ws-ink);
}
.wushi-hint { font-size: 11px; color: var(--ws-muted); line-height: 1.45; margin: 0; }
.wushi-spotlight {
  outline: 3px solid var(--ws-red) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 8px rgba(216,61,35,0.18) !important;
  transition: outline 0.2s ease;
}
.wushi-pointer {
  position: fixed;
  z-index: calc(var(--ws-z) + 20);
  width: 56px;
  height: 56px;
  pointer-events: none;
  transform: translate(-8px, -4px);
  transition: left 0.4s cubic-bezier(.2,.8,.2,1), top 0.4s cubic-bezier(.2,.8,.2,1);
  filter: drop-shadow(0 4px 10px rgba(32,34,31,0.45)) drop-shadow(0 0 0 2px rgba(244,243,237,0.9));
  background: none;
  border: none;
  border-radius: 0;
}
.wushi-pointer::before {
  content: "";
  display: block;
  width: 56px;
  height: 56px;
  background-repeat: no-repeat;
  background-size: 48px 48px;
  background-position: 0 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4 L8 38 L16.5 29.5 L22 42 L28 39.5 L22.5 27 L34 27 Z' fill='%2320221F' stroke='%23D83D23' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: wsPointerPulse 1.4s ease-out infinite;
}
@keyframes wsPointerPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .wushi-pointer::before { animation: none; }
  .wushi-pointer { transition: none; }
}
.wushi-pointer-label {
  position: fixed;
  z-index: calc(var(--ws-z) + 21);
  background: var(--ws-red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  border-radius: 3px;
  border: 2px solid var(--ws-ink);
  box-shadow: 0 10px 28px rgba(216,61,35,0.35);
  pointer-events: none;
  max-width: 280px;
  line-height: 1.4;
}
