/* ========================================
   鱼摆摆 重设计层 2026-11-17
   加载于所有既有样式之后，仅覆盖视觉细节。
   原有布局结构、DOM 和数据属性不变。
   ======================================== */

/* 1. 核心色彩修订 */
:root {
  --yb-coral:        #d4512a;
  --yb-coral-soft:   #fff0ea;
  --yb-shadow-1: 0 1px 2px rgb(20 43 49 / 5%), 0 2px 7px rgb(20 43 49 / 4%);
  --yb-shadow-2: 0 2px 6px rgb(20 43 49 / 5%), 0 10px 28px rgb(20 43 49 / 8%);
  --yb-shadow-3: 0 8px 24px rgb(20 43 49 / 9%), 0 28px 72px rgb(20 43 49 / 14%);
  --yb-ease: cubic-bezier(.22, 1, .36, 1);
  --yb-fast: 130ms;
  --yb-mid:  220ms;
  --yb-slow: 400ms;
}

html[data-yb-theme="dark"] {
  --yb-water:        var(--wb-accent);
  --yb-water-2:      var(--wb-accent-hover);
  --yb-water-soft:   var(--wb-accent-soft);
  --yb-water-mist:   var(--wb-subtle);
  --yb-paper:        var(--wb-canvas);
  --yb-canvas:       var(--wb-chrome);
  --yb-ink:          var(--wb-ink);
  --yb-ink-2:        #ddd;
  --yb-ink-3:        #bfbfbf;
  --yb-muted:        var(--wb-muted);
  --yb-faint:        var(--wb-muted);
  --yb-line:         var(--wb-line);
  --yb-line-strong:  var(--wb-line-strong);
  --yb-shadow-1: 0 1px 2px rgb(0 0 0 / 25%), 0 2px 7px rgb(0 0 0 / 18%);
  --yb-shadow-2: 0 2px 6px rgb(0 0 0 / 24%), 0 10px 28px rgb(0 0 0 / 32%);
  --yb-shadow-3: 0 8px 24px rgb(0 0 0 / 32%), 0 28px 72px rgb(0 0 0 / 44%);
}

/* 2. 导航轨道 */
.reference-mode .ref-rail {
  width: 56px;
  padding: 14px 8px 10px;
  background: var(--wb-chrome);
  border-inline-end: 1px solid var(--wb-line);
}

.reference-mode .ref-rail-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  margin-inline: auto;
  border-radius: 10px;
  color: var(--wb-muted);
  transition: background var(--yb-fast) var(--yb-ease),
              color var(--yb-fast) var(--yb-ease),
              transform var(--yb-fast) var(--yb-ease);
}

.reference-mode .ref-rail-button svg { width: 20px; height: 20px; }
.reference-mode .ref-rail-button:hover  { background: var(--wb-canvas); color: var(--wb-ink); transform: none; }
.reference-mode .ref-rail-button.active { background: var(--wb-accent-soft); color: var(--wb-accent); }
.reference-mode .ref-rail-button:active { transform: scale(.93); }
.reference-mode .ref-brand { margin-bottom: 12px; display: grid; place-items: center; }
.reference-mode .ref-brand small { display: none; }

/* 3. 侧栏 */
.reference-mode .ref-sidebar {
  background: var(--wb-chrome);
  border-inline-end: 1px solid var(--wb-line);
}

.reference-mode .ref-sidebar :is(.social-room, .ref-history-item, .ref-assistant-entry) {
  position: relative;
  transition: background var(--yb-fast) var(--yb-ease);
  overflow: hidden;
}



.reference-mode .ref-sidebar :is(.social-room, .ref-history-item).active::before {
  content: '';
  position: absolute;
  left: 0; 
  border-radius: 0 3px 3px 0;
}

.reference-mode .ref-sidebar .ref-sidebar-tab {
  font-size: 13px;
  font-weight: 500;
  transition: color var(--yb-fast) var(--yb-ease), background var(--yb-fast) var(--yb-ease);
}
.reference-mode .ref-sidebar .ref-sidebar-tab.active {
  font-weight: 650;
}

/* 4. 群聊气泡 — 提升优先级 */
body .social-bubble {
  padding: 10px 14px !important;
  border: 1px solid #e3eced !important;
  border-radius: 4px 16px 16px 16px !important;
  background: #f7fafb !important;
  color: #142b31 !important;
  font-size: 14.5px !important;
  line-height: 1.72 !important;
}

body .social-message.mine .social-bubble {
  padding: 10px 14px !important;
  border-color: transparent !important;
  border-radius: 16px 4px 16px 16px !important;
  background: var(--wb-accent-soft) !important;
  color: var(--wb-ink) !important;
}

/* 5. 运行状态标记 — 提升优先级 */
body .social-run {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  max-width: 100%;
  color: #56717a !important;
  background: #f0f7f6 !important;
  letter-spacing: .01em;
}
body .social-run.failed,
body .social-run.unknown { color: #8b3028 !important; background: #fdf0ee !important; }
body .social-run.blocked { color: #6b5425 !important; background: #faf5e8 !important; }
body .social-run.running,
body .social-run.queued  { color: #1a5a52 !important; background: #e9f7f4 !important; }
body .social-run.cancelled { color: #6b717a !important; background: #f4f5f6 !important; }

/* 6. 群聊输入框 — 提升优先级 */
body .social-chat .social-composer.social-composer-unified {
  border: 1px solid var(--wb-line-strong) !important;
  transition: border-color var(--yb-fast) var(--yb-ease), box-shadow var(--yb-mid) var(--yb-ease);
}
body .social-composer-unified [data-social-composer] {
  font-size: 15px !important;
  color: var(--wb-ink) !important;
  caret-color: var(--wb-accent) !important;
}
body .social-composer-unified [data-social-composer]::placeholder { color: var(--yb-faint) !important; }

body .social-send {
  border-radius: var(--wb-control-radius) !important;
  background: var(--wb-accent) !important;
  color: var(--wb-accent-text) !important;
}
body .social-send:hover:not(:disabled) { background: var(--wb-accent-hover) !important; }
body .social-send:disabled { opacity: .4 !important; }

/* 7. 视频导演 */
.video-flow-quick-upload {
  border: 1.5px dashed var(--yb-line-strong);
  border-radius: var(--wb-panel-radius);
  background: var(--yb-water-mist);
  color: var(--yb-water);
  transition: background var(--yb-fast) var(--yb-ease), border-color var(--yb-fast) var(--yb-ease);
}
.video-flow-quick-upload:hover {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
}

.video-flow-page .field-label { font-size: 12px; color: var(--yb-muted); font-weight: 500; letter-spacing: .02em; }
.video-flow-quick-brief > .field > .field-label { font-size: 15px; font-weight: 600; color: var(--yb-ink); letter-spacing: -.01em; }

.video-flow-quick-actions .button.primary {
  background: var(--wb-accent);
  border-color: var(--wb-accent);
  color: var(--wb-accent-text);
  box-shadow: 0 2px 8px rgb(20 100 90 / 22%);
}
.video-flow-quick-actions .button.primary:hover:not(:disabled) {
  background: var(--wb-accent-hover);
  border-color: var(--wb-accent-hover);
  box-shadow: 0 4px 14px rgb(20 100 90 / 28%);
}

.video-flow-step.active { color: var(--wb-accent); font-weight: 600; }
.video-flow-step.active > span:first-child { background: var(--wb-accent-soft); color: var(--wb-accent); }

/* 9. 空状态 */
.social-empty-chat h1 {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.4;
  color: var(--wb-ink);
}
.social-empty-chat p { font-size: 13.5px; color: var(--yb-muted); line-height: 1.75; }

.social-empty-actions .button.primary {
  background: var(--wb-accent);
  border-color: var(--wb-accent);
  color: var(--wb-accent-text);
  box-shadow: 0 2px 8px rgb(20 100 90 / 22%);
}

/* 10. 头像 */
.social-avatar { border-radius: 12px; }
.social-avatar.small { border-radius: 8px; }
.tactile-agent-orb { width: 100%; height: 100%; object-fit: contain; }
.tactile-avatar { border-radius: 12px; overflow: hidden; background: var(--wb-accent-soft); }
.tactile-avatar[data-identity-kind="ai"] { border-radius: 12px; }
.tactile-avatar[data-identity-kind="human"] { border-radius: 10px; }
.tactile-avatar-collage .tactile-member-cell { border-radius: 6px; overflow: hidden; }

/* 14. 商品图片页：CTA 对齐 */
body .simple-creation-submit,
body .simple-creation-actions .button.primary,
body .image-layout-submit,
body .fishing-brief-submit { background: var(--wb-accent) !important; border-color: var(--wb-accent) !important; color: var(--wb-accent-text) !important; }
body .simple-creation-submit:hover:not(:disabled),
body .image-layout-submit:hover:not(:disabled) { background: var(--wb-accent-hover) !important; border-color: var(--wb-accent-hover) !important; }

/* 15. 作品库、全部功能、经营助手：accent 对齐 */

/* 16. connections 路由修复：由于 validViewIds 缺少该路由，微信/电脑助手入口静默跳到 daily。
   这是 app.js 层的 JS 问题，CSS 层无法修复；已记录为受阻待补。 */

/* 13. Markdown 渲染内容样式 */
.yb-md-h {
  margin: 0.6em 0 0.2em;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--wb-ink);
  line-height: 1.4;
}
.yb-md-h:first-child { margin-top: 0; }
.yb-md-p { margin: 0 0 0.3em; line-height: 1.72; }
.yb-md-p:last-child { margin-bottom: 0; }
.yb-md-ul, .yb-md-ol { margin: 0.2em 0 0.4em; padding-inline-start: 1.4em; line-height: 1.65; }
.yb-md-ul > li, .yb-md-ol > li { margin: 0.1em 0; }
.social-bubble code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgb(20 100 90 / 8%);
  color: var(--wb-accent);
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  font-size: 0.88em;
}

/* 12. 减少动效 */
@media (prefers-reduced-motion: reduce) {
  .social-run, .video-flow-quick-upload,
  .reference-mode .ref-rail-button,
  .reference-mode .ref-sidebar :is(.social-room, .ref-history-item) { transition: none; }
}
html[data-motion="off"] .reference-mode .ref-rail-button,
html[data-motion="off"] .video-flow-quick-upload { transition: none; }

/* 17. 全局通知 Toast 移至右上角非遮挡悬浮层，彻底避免压盖输入舱底部工具与图标 */
body .notifications {
  top: 64px;
  right: 20px;
  bottom: auto;
  left: auto;
  transform: none;
  max-width: min(380px, calc(100vw - 32px));
  z-index: 160;
}
body .notifications :is(.toast, .notification) {
  background: var(--wb-canvas, #ffffff);
  color: var(--wb-ink, #142b31);
  border: 1px solid var(--wb-line-strong, #c8dbd8);
  border-radius: 12px;
  box-shadow: var(--yb-shadow-2);
  padding: 10px 14px;
}
body .notifications .toast {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) 24px;
  gap: 9px;
  align-items: baseline;
  padding: 8px 8px 8px 12px;
  border-radius: 9px;
  box-shadow: var(--wb-overlay-shadow);
  pointer-events: auto;
}
.toast > svg { align-self: start; margin-top: 4px; color: var(--wb-accent); }
.toast.error > svg { color: var(--wb-danger); }
.toast-message { overflow-wrap: anywhere; }
.toast .toast-dismiss {
  align-self: start; display: grid; place-items: center; width: 24px; height: 24px;
  padding: 0; border: none; border-radius: 5px; background: transparent; color: var(--wb-muted);
}
.toast-dismiss:hover, .toast-dismiss:focus-visible { background: var(--wb-subtle); color: var(--wb-ink); }
body .notifications :is(.toast.error, .notification.error) {
  border-color: #d97757;
  color: #b83228;
}
html[data-yb-theme="dark"] body .notifications :is(.toast.error, .notification.error) {
  border-color: #b45339;
  color: #f6b28f;
}
html[data-yb-theme="dark"] .yb-task-reminder-badge.is-scheduled {
  background: rgb(45 212 191 / 16%) !important;
  color: #7ee7d4 !important;
}
html[data-yb-theme="dark"] :is(.ref-home-workspace, .daily-chat, .conversation-model-picker) .model-picker-trigger {
  background: var(--wb-subtle, #19292e) !important;
  border-color: var(--wb-line-strong, #2e484b) !important;
  color: var(--wb-ink, #e2f1ef) !important;
}
html[data-yb-theme="dark"] .model-picker-trigger [data-identity-brand="openai"] :is(img, svg) {
  filter: brightness(0) invert(0.92);
}
@media (max-width: 760px) {
  body .notifications {
    top: 56px;
    right: 12px;
    left: 12px;
    bottom: auto;
    max-width: none;
  }
}
