/* Isolated workbench mock (界面示意). Loaded only from locale index pages.
   All rules are scoped under .workspace so site-wide colors, backgrounds,
   and decorative gradients are not affected. */

/* Diagonal gradients (top-left → bottom-right) for avatars and owner 1:1 bubbles only.
   Site-wide decorative --grad-* in :root stay vertical. */
.workspace{
  --grad-search: linear-gradient(135deg, #6fc5c1, #a6d3b8);
  --grad-writer: linear-gradient(135deg, #6fc5c1, #e8a0b4);
  --grad-chart: linear-gradient(135deg, #6fc5c1, #f0d29a);
  --grad-pack: linear-gradient(135deg, #6fc5c1, #afbed4);
  --fg-ink: #1c2b2a;
  --fg-white: #ffffff;
  --owner-fg: var(--fg-white);
  --knockout: #ffffff;
  /* Owner-bubble backgrounds (v7c): v7b stops (chroma x1.25) with OKLCH L
     lowered by 0.10, hue and C kept. Group stays #34827e. White text even
     if contrast is below 4.5:1. Avatars keep the pastel --grad-* above. */
  --owner-bg-coord: #2ba9a4;
  --owner-bg-search: linear-gradient(135deg, #2ba9a4, #7eb695);
  --owner-bg-writer: linear-gradient(135deg, #2ba9a4, #d17a94);
  --owner-bg-chart: linear-gradient(135deg, #2ba9a4, #d5b16a);
  --owner-bg-pack: linear-gradient(135deg, #2ba9a4, #8d9fba);
  --owner-bg-group: #34827e;
}

/* Outer card chrome = pre-v4d styles.css .workspace: 1px var(--line)
   (#d3e2e1), 24px radius, box-shadow 0 22px 60px #1c2b2a12.
   Re-assert on hover / :focus / :focus-within so a pause from the demo
   (hover or focusin) cannot add a ring. outline stays none on the card;
   keyboard rings are only .bot-contact:focus-visible. */
.workspace,
.workspace:hover,
.workspace:focus,
.workspace:focus-within{
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 22px 60px #1c2b2a12;
  outline: none;
}

.workspace .workspace-sprite{
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}


.workspace .bot-contact{
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace .bot-contact:focus-visible{
  outline: 3px solid #2c6d6a;
  outline-offset: 2px;
}

/* Sidebar: very light grey like Grok Bot (~#f7f8f8). Chat pane stays white.
   Knockouts in the list use the sidebar/row background, not a hard white. */
.workspace .bot-roster{
  background: #f7f8f8;
  --knockout: #f7f8f8;
}

.workspace .bot-contact:hover{
  background: #f1f2f2;
  --knockout: #f1f2f2;
}

.workspace .bot-contact.active{
  background: #ffffff;
  box-shadow: 0 1px 2px #1c2b2a12;
  --knockout: #ffffff;
}

/* 36px * 1.25 = 45px. Wrap is only a positioning context — no fill, border, or radius. */
.workspace .bot-avatar-wrap{
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  overflow: visible;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.workspace .bot-avatar{
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  background: none;
}

/* Colored cat head (site mascot: splay ears + disc). Masked so no square/circle plate shows.
   Mask is an inlined data URI (same paths as assets/bot-meow-head.svg). A relative
   url("bot-meow-head.svg") resolves correctly to /assets/ over HTTP, but Chromium
   blocks that file:// mask request (net::ERR_FAILED), leaving only ::after eye
   dots and the inline bow. Data URI needs no extra request. */
.workspace .bot-avatar::before{
  content: "";
  position: absolute;
  inset: 0;
  background: #6fc5c1;
  --head-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%2262%2068%20900%20900%22%20fill%3D%22%23fff%22%3E%20%3Cpath%20d%3D%22M200%20160L392%20276L200%20564Z%22%2F%3E%20%3Cpath%20d%3D%22M824%20160L824%20564L632%20276Z%22%2F%3E%20%3Ccircle%20cx%3D%22512%22%20cy%3D%22564%22%20r%3D%22312%22%2F%3E%20%3C%2Fsvg%3E");
  -webkit-mask: var(--head-mask) center / contain no-repeat;
  mask: var(--head-mask) center / contain no-repeat;
  pointer-events: none;
}

.workspace .bot-avatar--coord::before{ background: #6fc5c1; }
.workspace .bot-avatar--search::before{ background: var(--grad-search); }
.workspace .bot-avatar--writer::before{ background: var(--grad-writer); }
.workspace .bot-avatar--chart::before{ background: var(--grad-chart); }
.workspace .bot-avatar--pack::before{ background: var(--grad-pack); }

/* White eyes, placed on the face disc of the mascot viewBox (not masked). */
.workspace .bot-avatar::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, #fff 66%, transparent 71%) 36.67% 55.11% / 16.9% 16.9% no-repeat,
    radial-gradient(circle, #fff 66%, transparent 71%) 63.33% 55.11% / 16.9% 16.9% no-repeat;
}

/* Bow is an inline SVG that slightly overlaps the chin.
   A currentColor under-layer (stroke-width 4px, then a same-shape fill)
   leaves a 2px halo; the 1px design stroke covers the inner 0.5px, so the
   visible background gap is 1.5px. vector-effect: non-scaling-stroke. No drop-shadow. */
.workspace .coord-bow{
  position: absolute;
  left: 50%;
  top: 82%;
  z-index: 3;
  display: block;
  width: 16px;
  height: 9px;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: var(--knockout);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  outline: none;
  transform: translate(-50%, 0);
  pointer-events: none;
}

.workspace .coord-bow-knockout-stroke, .workspace .coord-bow-knockout-stroke *{
  fill: none;
  stroke: currentColor;
  stroke-width: 4px;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.workspace .coord-bow-knockout-fill, .workspace .coord-bow-knockout-fill *{
  fill: currentColor;
  stroke: none;
}

.workspace .coord-bow-face, .workspace .coord-bow-face *{
  fill: #e8a0b4;
  stroke: #2c6d6a;
  stroke-width: 1px;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  vector-effect: non-scaling-stroke;
}

.workspace .bot-contact[data-bot="coord"] .bot-avatar-wrap, .workspace .chat-head .bot-avatar-wrap, .workspace .message .bot-avatar-wrap{
  margin-bottom: 8px;
}

/* Group avatar is one inline SVG cluster. Front heads use a currentColor
   stroke (3px, paint-order: stroke fill, non-scaling-stroke) so the visible
   knockout gap is 1.5px in the container background. No drop-shadow. */
.workspace .group-avatar{
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  overflow: visible;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  color: var(--knockout);
}

.workspace .group-avatar-svg{
  display: block;
  width: 46px;
  height: 46px;
  overflow: visible;
  color: var(--knockout);
}

.workspace .group-avatar-svg .cat-halo-shape{
  fill: none;
  stroke: currentColor;
  stroke-width: 3px;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.workspace .group-avatar-svg .cat-sil{
  stroke: none;
}

.workspace .group-avatar-svg .cat-eyes{
  stroke: none;
  fill: #fff;
}

.workspace .chat-head{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.workspace .chat-head strong, .workspace .chat-head small{ display: block; }
.workspace .chat-head strong{ font-size: 13px; }
.workspace .chat-head small{ margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }

.workspace .workspace-body{
  grid-template-columns: 210px 1fr;
  height: 720px;
}

.workspace .chat{
  display: flex;
  flex-direction: column;
  height: 720px;
  box-sizing: border-box;
  overflow: hidden;
}

.workspace .chat-panes{
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.workspace .chat-pane{
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease, visibility 0.32s ease;
}

.workspace .chat-pane.is-active{
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.workspace .chat-system{
  margin: 10px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

/* Bot replies (1:1 and group): uniform light grey like Grok Bot, ink text. */
.workspace .message.bot-line p{
  background: #f0f2f2;
  color: var(--ink);
}

/* 1:1 owner bubbles: per-bot diagonal gradient, always white text.
   Backgrounds are v7b colors with OKLCH L lowered by 0.10 (hue and C kept),
   midway-ish toward v7 but not as dark. Contrast may still be below 4.5:1.
   Avatars still use the original --grad-*. */
.workspace .chat-pane[data-step="coord"]{ --owner-bg: var(--owner-bg-coord); }
.workspace .chat-pane[data-step="search"]{ --owner-bg: var(--owner-bg-search); }
.workspace .chat-pane[data-step="writer"]{ --owner-bg: var(--owner-bg-writer); }
.workspace .chat-pane[data-step="chart"]{ --owner-bg: var(--owner-bg-chart); }
.workspace .chat-pane[data-step="pack"]{ --owner-bg: var(--owner-bg-pack); }
.workspace .chat-pane[data-step="group-chat"]{ --owner-bg: var(--owner-bg-group); }

.workspace .chat-pane[data-step="coord"] .message.user:not(.human-line) p,
.workspace .chat-pane[data-step="search"] .message.user:not(.human-line) p,
.workspace .chat-pane[data-step="writer"] .message.user:not(.human-line) p,
.workspace .chat-pane[data-step="chart"] .message.user:not(.human-line) p,
.workspace .chat-pane[data-step="pack"] .message.user:not(.human-line) p{
  background: var(--owner-bg);
  color: var(--owner-fg, var(--fg-white));
}

.workspace .chat-pane[data-owner-fg="white"]{ --owner-fg: var(--fg-white); }

/* Group chat owner: same #34827e as v6 (white 4.526:1). Not chroma-boosted. */
.workspace .chat-pane[data-step="group-chat"] .message.user.human-line--self p{
  background: var(--owner-bg, #34827e);
  color: var(--owner-fg, var(--fg-white));
}

.workspace .message .bot-avatar-wrap, .workspace .message .bot-avatar{
  width: 40px;
  height: 40px;
}

.workspace .message .bot-avatar-wrap{
  margin-bottom: 10px;
}

.workspace .message .coord-bow{
  width: 14px;
  height: 8px;
  top: 82%;
}

.workspace .message .group-avatar, .workspace .message .group-avatar-svg{
  width: 42px;
  height: 42px;
}

/* Human teammates: initial-letter avatars, neutral bubbles, ink text. */
.workspace .human-avatar{
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
}

.workspace .human-avatar--l{ background: #dbe2de; }
.workspace .human-avatar--h{ background: #e6e2da; }
.workspace .human-avatar--n{ background: #dee1ea; }

.workspace .message.human-line, .workspace .message.bot-line{
  align-items: flex-start;
}

.workspace .message.human-line .message-body, .workspace .message.bot-line .message-body{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 85%;
  min-width: 0;
}

.workspace .message .msg-name{
  margin: 0 0 3px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

/* Default teammate fill (unused in 1:1). Group-chat teammates are overridden below. */
.workspace .message.human-line p{
  background: #f0f2f2;
  color: var(--ink);
}

/* Group-chat teammates (not the owner): same light grey as bot bubbles,
   plus a 1.5px logo-teal border so they still read as human. #34827e on
   #f0f2f2 is clearly visible at 1.5px (~4.0:1); the lighter logo #6fc5c1
   would be only ~1.8:1 and too faint. Padding is reduced by 1.5px so the
   border does not grow the bubble or crowd the text vs 10px 13px + no border.
   Owner group bubbles stay solid #34827e with no extra border. */
.workspace .chat-pane[data-step="group-chat"] .message.human-line:not(.human-line--self) p{
  background: #f0f2f2;
  color: var(--ink);
  border: 1.5px solid #34827e;
  padding: 8.5px 11.5px;
}

.workspace .message.human-line--self{
  justify-content: flex-end;
}

.workspace .message.human-line--self .message-body{
  align-items: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  .workspace .chat-pane{
    animation: none;
    transition: none;
    transform: none;
  }
}

@media (max-width: 640px) {
  .workspace .bot-contact[data-bot="coord"] .bot-avatar-wrap{
    margin-bottom: 8px;
  }
  .workspace .chat-head{ margin-top: 0; }
  .workspace .message .bot-avatar-wrap, .workspace .message .bot-avatar, .workspace .message .human-avatar, .workspace .message .group-avatar{
    display: none;
  }
  .workspace .message .msg-name{ display: block; }
  /* Group chat keeps avatars so ears, bow, and human initials stay visible. */
  .workspace .chat-pane[data-step="group-chat"] .message .bot-avatar-wrap, .workspace .chat-pane[data-step="group-chat"] .message .bot-avatar, .workspace .chat-pane[data-step="group-chat"] .message .human-avatar{
    display: inline-block;
  }
  .workspace .chat-pane[data-step="group-chat"] .message .human-avatar{
    display: grid;
  }
}
