/* 微光AI — 经典 QQ 聊天窗口风格 */
:root {
  --footer-bar-h: 34px;
  --qq-title: linear-gradient(180deg, #6eb4ff 0%, #4a9ef5 45%, #3d8ee8 100%);
  --qq-title-border: #2d7ad4;
  --qq-divider-blue: #4a9ef5;
  --qq-sidebar: #f5f5f5;
  --qq-sidebar-hover: #bfe0ff;
  --qq-sidebar-active: #7eb8fc;
  --qq-chat-bg: #f0f0f0;
  --qq-bubble-other: #fff;
  --qq-bubble-other-border: #b8b8b8;
  --qq-bubble-self: #9eea6e;
  --qq-bubble-self-border: #52b434;
  --qq-input-bg: #fff;
  --qq-border: #e5e5e5;
  --qq-divider: #ebebeb;
  --qq-text: #333;
  --qq-text-muted: #000;
  --qq-subtitle: #000;
  --qq-send: linear-gradient(180deg, #5cadff 0%, #3d96f0 100%);
  --qq-window-shadow: 0 8px 32px rgba(0, 40, 100, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
  --qq-radius: 6px;
  --qq-titlebar-h: 32px;
  /* 主内容区在顶栏之下；顶栏 z-index 见 .page-weiguang .site-header */
  --wg-layer-chrome: 20;
  --wg-layer-main: 10;
  --wg-layer-window: 20;
  --wg-layer-window-active: 30;
  --font-qq: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 与官网顶栏、页脚共存：背景与首页一致 */
.page-weiguang {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--color-bg-deep);
  color: var(--color-text);
}

.page-weiguang #bg-canvas,
.page-weiguang .grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page-weiguang .nav a.active {
  color: var(--color-text);
}

.page-weiguang .nav a.active::after {
  width: 100%;
}

/* 顶栏必须高于主内容层，否则 page-layout 全屏占位会挡住导航链接点击 */
.page-weiguang .site-header {
  z-index: 140;
}

/* 顶栏固定；底栏 fixed 贴视口最底 */
.page-layout {
  position: relative;
  z-index: var(--wg-layer-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--header-h, 72px);
  padding-bottom: var(--footer-bar-h);
  box-sizing: border-box;
}

.wg-main {
  position: relative;
  z-index: var(--wg-layer-window);
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px;
  min-height: 0;
  overflow: hidden;
  font-family: var(--font-qq);
  font-size: 12px;
  color: var(--qq-text);
}

.page-weiguang .site-footer--bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--wg-layer-chrome);
  width: 100%;
  margin: 0;
  padding: 6px 20px;
  border-top: 1px solid var(--color-border);
  background: rgba(5, 8, 16, 0.98);
  box-sizing: border-box;
}

.page-weiguang .site-footer--bar .footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 22px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.page-weiguang .site-footer--bar .footer-copy,
.page-weiguang .site-footer--bar .footer-mail,
.page-weiguang .site-footer--bar .footer-icp,
.page-weiguang .site-footer--bar .footer-psb {
  margin: 0;
  font-size: 0.78rem;
  color: var(--color-text-dim);
  white-space: nowrap;
}

.page-weiguang .site-footer--bar .footer-mail:hover,
.page-weiguang .site-footer--bar .footer-icp:hover,
.page-weiguang .site-footer--bar .footer-psb:hover {
  color: var(--color-primary);
}

.page-weiguang .site-footer--bar .footer-psb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.page-weiguang .site-footer--bar .footer-psb img {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 主窗口：默认顶对齐、高度铺满 wg-main（上下边线之间） */
.qq-window {
  --qq-win-min-w: 520px;
  --qq-win-min-h: 380px;
  --qq-win-pad: 0px;
  width: min(920px, 100%);
  height: 100%;
  min-width: var(--qq-win-min-w);
  min-height: var(--qq-win-min-h);
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: var(--wg-layer-window);
  background: var(--qq-sidebar);
  border: 1px solid var(--qq-title-border);
  border-radius: var(--qq-radius);
  box-shadow: var(--qq-window-shadow);
  overflow: hidden;
  flex-shrink: 0;
}

/* 顶对齐铺满槽位（未拖走前保持在文档流内，避免 wg-main 高度塌陷） */
.qq-window.is-top-pinned:not(.is-dragged):not(.is-maximized) {
  width: min(920px, 100%);
  height: 100%;
  max-height: 100%;
  flex-shrink: 0;
}

.qq-window.is-dragged,
.qq-window.is-sized,
.qq-window.is-resizing,
.qq-window.is-maximized {
  position: absolute;
  margin: 0;
  z-index: var(--wg-layer-window-active);
  max-width: none;
  max-height: none;
}

.qq-window.is-maximized {
  border-radius: 4px;
}

.qq-window.minimized {
  height: 32px !important;
  min-height: 32px !important;
  overflow: hidden;
}

.qq-window.minimized .qq-body,
.qq-window.minimized .qq-resize-handle {
  display: none;
}

.qq-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  z-index: 8;
  cursor: nwse-resize;
  background: linear-gradient(
    135deg,
    transparent 0 55%,
    rgba(61, 142, 232, 0.45) 55% 70%,
    rgba(45, 122, 212, 0.75) 70% 100%
  );
  border-bottom-right-radius: var(--qq-radius);
}

.qq-window.is-resizing .qq-resize-handle {
  background: linear-gradient(
    135deg,
    transparent 0 50%,
    rgba(45, 122, 212, 0.9) 50% 100%
  );
}

/* 标题栏 */
.qq-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: var(--qq-titlebar-h);
  padding: 0 8px 0 10px;
  background: var(--qq-title);
  border-bottom: 1px solid var(--qq-title-border);
  flex-shrink: 0;
  user-select: none;
  cursor: move;
}

.qq-titlebar-leading {
  display: flex;
  align-items: center;
  min-width: 0;
  grid-column: 1;
}

.qq-titlebar.is-grabbing {
  cursor: grabbing;
}

.qq-titlebar .qq-win-btn {
  cursor: default;
}

.qq-titlebar-logo {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 3px;
  object-fit: contain;
}

.qq-titlebar-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 50, 120, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qq-titlebar-download {
  grid-column: 2;
  justify-self: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.38);
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 50, 120, 0.35);
  transition: background 0.15s ease;
}

.qq-titlebar-download:hover {
  background: rgba(255, 255, 255, 0.3);
}

.qq-titlebar-btns {
  display: flex;
  gap: 2px;
  grid-column: 3;
  justify-self: end;
}

.qq-win-btn {
  width: 28px;
  height: 22px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: default;
  border-radius: 3px;
  opacity: 0.9;
}

.qq-win-btn:hover { background: rgba(255, 255, 255, 0.2); }
.qq-win-btn.close:hover { background: #e81123; }

/* 主体 */
.qq-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* 左侧联系人 */
.qq-sidebar {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--qq-sidebar);
  border-right: 1px solid var(--qq-divider-blue);
}

.qq-groups {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.qq-sidebar-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--qq-titlebar-h);
  padding: 0 10px;
  border-top: 1px solid var(--qq-title-border);
  background: var(--qq-title);
}

.qq-sidebar-login-btn {
  min-width: 72px;
  height: 22px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 50, 120, 0.35);
  transition: background 0.15s, border-color 0.15s;
}

.qq-sidebar-login-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.85);
}

.qq-sidebar-login-btn:active {
  background: rgba(255, 255, 255, 0.18);
}

.qq-group-title {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--qq-subtitle);
  background: #ebebeb;
  border-top: 1px solid var(--qq-divider);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.qq-group-title::before {
  content: "▼";
  font-size: 8px;
  transition: transform 0.2s;
}

.qq-group.collapsed .qq-group-title::before { transform: rotate(-90deg); }
.qq-group.collapsed .qq-contact-list { display: none; }

.qq-contact-list { list-style: none; }

.qq-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--qq-divider);
  transition: background 0.15s;
}

.qq-contact:hover { background: var(--qq-sidebar-hover); }
.qq-contact.active {
  background: var(--qq-sidebar-active);
  box-shadow: inset 3px 0 0 var(--qq-title-border);
}

.qq-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7eb8ff, #4a9ef5);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(74, 158, 245, 0.25);
}

.qq-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 20px;
  border-radius: 12px;
}

.qq-avatar--weiguang { background: linear-gradient(135deg, #7c5cff, #a855f7); }
.qq-avatar--office { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.qq-avatar--paint { background: linear-gradient(135deg, #f472b6, #fb923c); }
.qq-avatar--video { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.qq-avatar--song { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.qq-avatar--writing { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.qq-avatar--legal { background: linear-gradient(135deg, #64748b, #475569); }
.qq-avatar--emotion { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.qq-avatar--code { background: linear-gradient(135deg, #0ea5e9, #2563eb); }

.qq-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qq-contact-info { min-width: 0; flex: 1; }

.qq-contact-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.qq-contact-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.qq-contact-name--weiguang { background-image: linear-gradient(90deg, #6d28d9, #db2777); }
.qq-contact-name--office { background-image: linear-gradient(90deg, #1d4ed8, #0891b2); }
.qq-contact-name--paint { background-image: linear-gradient(90deg, #db2777, #ea580c); }
.qq-contact-name--video { background-image: linear-gradient(90deg, #4f46e5, #7c3aed); }
.qq-contact-name--song { background-image: linear-gradient(90deg, #059669, #0d9488); }
.qq-contact-name--writing { background-image: linear-gradient(90deg, #d97706, #dc2626); }
.qq-contact-name--legal { background-image: linear-gradient(90deg, #475569, #334155); }
.qq-contact-name--emotion { background-image: linear-gradient(90deg, #db2777, #e11d48); }
.qq-contact-name--code { background-image: linear-gradient(90deg, #0284c7, #1d4ed8); }

.qq-chat-title-name {
  font-size: 18px;
}

.qq-contact-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: linear-gradient(90deg, #64748b, #475569);
}

.qq-contact-tag--weiguang { background: linear-gradient(90deg, #7c3aed, #c026d3); }
.qq-contact-tag--office { background: linear-gradient(90deg, #1d4ed8, #0891b2); }
.qq-contact-tag--paint,
.qq-contact-tag--video { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.qq-contact-tag--song { background: linear-gradient(90deg, #059669, #0d9488); }
.qq-contact-tag--writing { background: linear-gradient(90deg, #d97706, #dc2626); }
.qq-contact-tag--legal { background: linear-gradient(90deg, #475569, #334155); }
.qq-contact-tag--emotion { background: linear-gradient(90deg, #db2777, #e11d48); }
.qq-contact-tag--code { background: linear-gradient(90deg, #0284c7, #1d4ed8); }

#chat-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  border: none;
}

.qq-contact-preview {
  font-size: 11px;
  color: var(--qq-subtitle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.qq-contact.is-busy .qq-contact-preview {
  color: var(--qq-subtitle);
}

@keyframes qq-avatar-notify {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(74, 158, 245, 0.25);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(74, 158, 245, 0.5), 0 4px 14px rgba(74, 158, 245, 0.45);
    filter: brightness(1.2);
  }
}

.qq-avatar.qq-avatar--notify {
  animation: qq-avatar-notify 0.85s ease-in-out infinite;
}

.qq-status-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52c41a;
  border: 1px solid #fff;
  flex-shrink: 0;
}

.qq-status-dot.offline { background: #bbb; }

/* 右侧聊天区 */
.qq-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--qq-chat-bg);
}

.qq-chat--studio .qq-messages {
  flex: 1 1 0;
  min-height: 0;
}

.qq-chat-header {
  height: 52px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
  border-bottom: 1px solid var(--qq-divider-blue);
  flex-shrink: 0;
}

.qq-chat-header .qq-avatar { width: 44px; height: 44px; }

.wg-quota-bar {
  margin: 0;
  padding: 6px 14px;
  font-size: 11px;
  line-height: 1.4;
  color: #5a6b7d;
  background: linear-gradient(90deg, #f0f7ff 0%, #f8fbff 100%);
  border-bottom: 1px solid #e3edf7;
}

.qq-chat-title {
  min-width: 0;
  flex: 1;
}

.qq-chat-title h2 {
  font-size: 14px;
  font-weight: 600;
}

.qq-chat-title p,
#chat-status {
  font-size: 11px;
  color: var(--qq-subtitle);
  margin-top: 2px;
}

/* 绘画 / 媒体专精 — 固定参数栏（不随消息滚动） */
.qq-media-studio {
  flex-shrink: 0;
  background: linear-gradient(180deg, #fafcff 0%, #f5f9ff 100%);
  border-bottom: 1px solid var(--qq-divider-blue);
  padding: 8px 12px 10px;
  z-index: 2;
}

.qq-media-studio[hidden] {
  display: none !important;
}

/* 四列矩阵：第2行第4列参考图；提示词行右侧为生成按钮 */
.qq-media-studio-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 2px;
  align-items: start;
}

.qq-media-studio-matrix .qq-media-field {
  min-width: 0;
}

.qq-media-studio-matrix .qq-media-field[hidden],
.qq-media-studio-matrix .qq-media-field.is-off {
  display: none !important;
}

/* 首帧 / 尾帧 / 配音：独立一行横排，避免与第2行表单项叠在同一格 */
.qq-media-studio-upload-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 6px;
  padding: 2px 0 4px;
}

.qq-media-studio-upload-row[hidden] {
  display: none !important;
}

.qq-media-studio-ref {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  flex: 0 0 auto;
}

.qq-media-studio-ref[hidden],
.qq-media-studio-ref.is-off {
  display: none !important;
}

.qq-media-prompt-cell {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* 歌曲工作台参数较多：提示词与生成按钮排在最底行 */
.qq-media-studio-matrix--song .qq-media-prompt-cell,
.qq-media-prompt-cell--bottom {
  grid-row: auto;
  order: 99;
  margin-top: 8px;
}

.qq-media-prompt-cell .qq-media-gen-btn {
  flex-shrink: 0;
  height: 52px;
  min-width: 72px;
  margin: 0;
}

.qq-media-field {
  display: flex;
  flex-direction: column;
}

.qq-media-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #1a5fb4;
  line-height: 1.2;
}

.qq-media-field select {
  width: 100%;
  height: 28px;
  margin-top: 2px;
  padding: 0 6px;
  font-size: 12px;
  border: 1px solid #b8d4f0;
  border-radius: 4px;
  background: #fff;
  color: #333;
  outline: none;
}

.qq-media-field select:focus {
  border-color: #4a9ef5;
}

.qq-media-prompt-wrap {
  flex: 1;
  min-width: 0;
}

.qq-media-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.qq-media-prompt-head .qq-media-field-label {
  margin-bottom: 0;
}

.qq-media-polish-btn {
  flex-shrink: 0;
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
  line-height: 24px;
  border: 1px solid #7eb8fc;
  border-radius: 12px;
  background: #f0f7ff;
  color: #2d7ad4;
  cursor: pointer;
  white-space: nowrap;
}

.qq-media-polish-btn:hover:not(:disabled) {
  background: #e0efff;
  border-color: #4a9ef5;
}

.qq-media-polish-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.qq-media-prompt-wrap .qq-media-field-label {
  display: block;
  margin-bottom: 4px;
}

.qq-media-prompt {
  display: block;
  width: 100%;
  min-height: 52px;
  max-height: 88px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid #7eb8fc;
  border-radius: 6px;
  resize: vertical;
  outline: none;
  background: #fff;
}

.qq-media-prompt:focus {
  border-color: #4a9ef5;
  box-shadow: 0 0 0 1px rgba(74, 158, 245, 0.2);
}

.qq-media-studio-actions .qq-media-upload-hint {
  max-width: none;
  font-size: 10px;
  line-height: 1;
}

.qq-media-upload-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  border: 1px dashed #7eb8fc;
  border-radius: 8px;
  background: #fff;
  color: #2d7ad4;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.qq-media-upload-btn:hover {
  border-color: #4a9ef5;
  background: #eef5ff;
}

.qq-media-upload-btn.has-file {
  border-style: solid;
  background: #e8f4ff;
}

.qq-media-upload-hint {
  font-size: 10px;
  color: var(--qq-subtitle);
  text-align: center;
  max-width: 52px;
  line-height: 1.2;
}

.qq-media-ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  max-width: 100%;
}

.qq-media-ref-strip .qq-media-ref-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
}

.qq-media-studio-ref--audio .qq-media-upload-hint {
  max-width: 5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qq-media-ref-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #b8d4f0;
}

.qq-media-studio-actions .qq-media-gen-btn {
  height: 36px;
  padding: 0 14px;
  margin: 0;
}

.qq-media-gen-btn {
  height: 32px;
  padding: 0 16px;
  border: 1px solid #2d7ad4;
  border-radius: 6px;
  background: var(--qq-send);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 50, 120, 0.25);
}

.qq-media-gen-btn:hover {
  filter: brightness(1.05);
}

.qq-media-gen-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.qq-media-studio-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--qq-subtitle);
}

.qq-media-studio-extra label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .qq-media-studio-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .qq-media-studio-upload-row {
    justify-content: flex-start;
    gap: 10px;
  }
  .qq-media-prompt-cell {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
  .qq-media-prompt-cell .qq-media-gen-btn {
    width: 100%;
    height: 36px;
  }
}

/* 消息区 */
.qq-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 14px;
  background: var(--qq-chat-bg);
}

.qq-msg-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.qq-msg-row.self {
  flex-direction: row-reverse;
}

.qq-msg-row .qq-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.qq-msg-body { max-width: 68%; }

.qq-msg-name {
  font-size: 11px;
  color: var(--qq-subtitle);
  margin-bottom: 4px;
}

.qq-msg-row.self .qq-msg-name { text-align: right; }

.qq-bubble-typing {
  color: #888;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
}

.qq-bubble-streaming::after {
  content: "▍";
  display: inline;
  animation: qq-stream-caret 0.9s step-end infinite;
  color: #4a9ef5;
  margin-left: 2px;
}

@keyframes qq-stream-caret {
  50% { opacity: 0; }
}

.qq-bubble {
  position: relative;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.qq-msg-row:not(.self) .qq-bubble {
  background: var(--qq-bubble-other);
  border: 1.5px solid var(--qq-bubble-other-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.qq-msg-row:not(.self) .qq-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  border: 6px solid transparent;
  border-right-color: #fff;
  filter: drop-shadow(-1.5px 0 0 var(--qq-bubble-other-border));
}

.qq-msg-row.self .qq-bubble {
  background: var(--qq-bubble-self);
  border: 1.5px solid var(--qq-bubble-self-border);
  box-shadow: 0 1px 3px rgba(60, 140, 40, 0.15);
}

.qq-msg-row.self .qq-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 10px;
  border: 6px solid transparent;
  border-left-color: var(--qq-bubble-self);
  filter: drop-shadow(1.5px 0 0 var(--qq-bubble-self-border));
}

.qq-msg-time {
  font-size: 10px;
  color: var(--qq-subtitle);
  text-align: center;
  margin: 12px 0;
}

/* 输入区 */
.qq-input-area {
  position: relative;
  flex-shrink: 0;
  background: #fafafa;
  border-top: 1px solid var(--qq-divider-blue);
  box-shadow: inset 0 1px 0 rgba(74, 158, 245, 0.12);
}

.qq-input-area[hidden] {
  display: none !important;
}

.qq-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 4px;
  min-height: 40px;
  box-sizing: border-box;
}

/* 非微光AI：工具栏留白，供自定义扩展 */
.qq-toolbar.qq-toolbar--reserved {
  min-height: 40px;
}

.qq-toolbar.qq-toolbar--reserved .qq-tool-btn {
  display: none !important;
}

.qq-office-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.qq-office-toolbar[hidden] {
  display: none !important;
}

.qq-office-quick-btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #c5ddf7;
  border-radius: 4px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  color: #1a5fb4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.qq-office-quick-btn:hover {
  border-color: #4a9ef5;
  background: #e3f1ff;
  box-shadow: 0 1px 4px rgba(74, 158, 245, 0.25);
}

.qq-office-quick-btn:active {
  transform: translateY(1px);
}

.qq-office-quick-btn[data-office-kind="excel"] {
  border-color: #b7dfc4;
  color: #1b6b3a;
  background: linear-gradient(180deg, #f6fff9 0%, #eaf8ef 100%);
}

.qq-office-quick-btn[data-office-kind="excel"]:hover {
  border-color: #3d9b5c;
  background: #dff5e8;
}

.qq-office-quick-btn[data-office-kind="word"] {
  border-color: #c5d4f7;
  color: #1a4a8a;
  background: linear-gradient(180deg, #f7f9ff 0%, #edf2ff 100%);
}

.qq-office-quick-btn[data-office-kind="ppt"] {
  border-color: #f0c9b8;
  color: #a34b2d;
  background: linear-gradient(180deg, #fffaf7 0%, #fff0ea 100%);
}

.qq-code-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.qq-code-toolbar[hidden] {
  display: none !important;
}

.qq-code-quick-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  color: #0369a1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.qq-code-quick-btn:hover {
  border-color: #0284c7;
  background: #bae6fd;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.25);
}

.qq-code-quick-btn:active {
  transform: translateY(1px);
}

.qq-code-quick-btn[data-code-kind="bug"] {
  border-color: #fca5a5;
  color: #b91c1c;
  background: linear-gradient(180deg, #fff5f5 0%, #fee2e2 100%);
}

.qq-code-quick-btn[data-code-kind="game"] {
  border-color: #c4b5fd;
  color: #5b21b6;
  background: linear-gradient(180deg, #faf5ff 0%, #ede9fe 100%);
}

.qq-code-quick-btn[data-code-kind="web"] {
  border-color: #7dd3fc;
  color: #0c4a6e;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}

.qq-code-quick-btn[data-code-kind="python"] {
  border-color: #86efac;
  color: #166534;
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
}

.qq-code-quick-btn[data-code-kind="guide"] {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}

.qq-emotion-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.qq-emotion-toolbar[hidden] {
  display: none !important;
}

.qq-emotion-quick-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #f9a8d4;
  border-radius: 4px;
  background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 100%);
  color: #be185d;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.qq-emotion-quick-btn:hover {
  border-color: #ec4899;
  background: #fbcfe8;
  box-shadow: 0 1px 4px rgba(219, 39, 119, 0.25);
}

.qq-emotion-quick-btn:active {
  transform: translateY(1px);
}

.qq-emotion-quick-btn[data-emotion-kind="couple"] {
  border-color: #f9a8d4;
  color: #9d174d;
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
}

.qq-emotion-quick-btn[data-emotion-kind="marriage"] {
  border-color: #fda4af;
  color: #be123c;
  background: linear-gradient(180deg, #fff5f5 0%, #ffe4e6 100%);
}

.qq-emotion-quick-btn[data-emotion-kind="emo"] {
  border-color: #c4b5fd;
  color: #6d28d9;
  background: linear-gradient(180deg, #faf5ff 0%, #ede9fe 100%);
}

.qq-emotion-quick-btn[data-emotion-kind="vent"] {
  border-color: #f9a8d4;
  color: #db2777;
  background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 100%);
}

.qq-emotion-quick-btn[data-emotion-kind="depress"] {
  border-color: #a5b4fc;
  color: #4338ca;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
}

.qq-legal-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.qq-legal-toolbar[hidden] {
  display: none !important;
}

.qq-legal-quick-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.qq-legal-quick-btn:hover {
  border-color: #475569;
  background: #e2e8f0;
  box-shadow: 0 1px 4px rgba(51, 65, 85, 0.25);
}

.qq-legal-quick-btn:active {
  transform: translateY(1px);
}

.qq-legal-quick-btn[data-legal-kind="dispute"] {
  border-color: #fca5a5;
  color: #991b1b;
  background: linear-gradient(180deg, #fff5f5 0%, #fee2e2 100%);
}

.qq-legal-quick-btn[data-legal-kind="draft"] {
  border-color: #93c5fd;
  color: #1e40af;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}

.qq-legal-quick-btn[data-legal-kind="basics"] {
  border-color: #94a3b8;
  color: #334155;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

.qq-legal-quick-btn[data-legal-kind="case"] {
  border-color: #a78bfa;
  color: #5b21b6;
  background: linear-gradient(180deg, #faf5ff 0%, #ede9fe 100%);
}

.qq-writing-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.qq-writing-toolbar[hidden] {
  display: none !important;
}

.qq-writing-quick-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #fdba74;
  border-radius: 4px;
  background: linear-gradient(180deg, #fffbeb 0%, #ffedd5 100%);
  color: #c2410c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.qq-writing-quick-btn:hover {
  border-color: #ea580c;
  background: #fed7aa;
  box-shadow: 0 1px 4px rgba(234, 88, 12, 0.25);
}

.qq-writing-quick-btn:active {
  transform: translateY(1px);
}

.qq-writing-quick-btn[data-writing-kind="short"] {
  border-color: #fbbf24;
  color: #b45309;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.qq-writing-quick-btn[data-writing-kind="webnovel"] {
  border-color: #fb923c;
  color: #c2410c;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}

.qq-writing-quick-btn[data-writing-kind="inspire"] {
  border-color: #a78bfa;
  color: #6d28d9;
  background: linear-gradient(180deg, #faf5ff 0%, #ede9fe 100%);
}

.qq-writing-quick-btn[data-writing-kind="brainstorm"] {
  border-color: #60a5fa;
  color: #1d4ed8;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}

.qq-writing-quick-btn[data-writing-kind="hook"] {
  border-color: #f87171;
  color: #b91c1c;
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
}

.qq-tool-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  display: grid;
  place-items: center;
}

.qq-tool-btn:hover {
  background: #e8e8e8;
}

.qq-tool-btn.is-active {
  background: #7eb8fc;
  color: #fff;
}

.qq-tool-btn.is-recording {
  background: #ffebee;
  color: #c62828;
  animation: qq-voice-pulse 1s ease-in-out infinite;
}

@keyframes qq-voice-pulse {
  50% { opacity: 0.65; }
}

.qq-emoji-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% - 4px);
  z-index: 50;
  padding: 10px;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}

.qq-emoji-panel[hidden] {
  display: none !important;
}

.qq-emoji-item {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.qq-emoji-item:hover {
  background: #eef5ff;
}

/* 区域截图 */
.qq-snip-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  user-select: none;
}

.qq-snip-hint {
  flex-shrink: 0;
  padding: 10px 16px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.35);
}

.qq-snip-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: crosshair;
}

.qq-snip-img {
  position: absolute;
  display: block;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.qq-snip-shade {
  position: absolute;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.qq-snip-selection {
  position: absolute;
  border: 2px solid #4a9ef5;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  background: transparent;
  pointer-events: none;
  display: none;
}

.qq-snip-selection.is-visible {
  display: block;
}

.qq-snip-size {
  position: absolute;
  left: 0;
  top: -24px;
  padding: 2px 8px;
  font-size: 12px;
  color: #fff;
  background: rgba(45, 122, 212, 0.92);
  border-radius: 3px;
  white-space: nowrap;
}


.qq-snip-wait-bar {
  padding: 6px 12px;
  font-size: 12px;
  color: #2d7ad4;
  background: #e8f3ff;
  border-bottom: 1px solid #c5ddf7;
  text-align: center;
}

.qq-snip-wait-bar[hidden] {
  display: none !important;
}

.qq-input-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 0;
  max-height: 120px;
  overflow-y: auto;
}

.qq-input-attachments[hidden] {
  display: none !important;
}

.qq-input-attach-item {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #d0d0d0;
  background: #eee;
}

.qq-input-attach-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qq-input-attach-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.qq-input-attach-remove:hover {
  background: rgba(200, 40, 40, 0.9);
}

.qq-input-wrap {
  position: relative;
  margin: 2px 10px 8px;
  border: 1px solid #7eb8fc;
  border-radius: 6px;
  background: var(--qq-input-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.qq-input-wrap:focus-within {
  border-color: #4a9ef5;
  box-shadow: 0 0 0 1px rgba(74, 158, 245, 0.25);
}

.qq-input-wrap.is-dragover {
  border-color: #4a9ef5;
  background: #f0f7ff;
}

.qq-input {
  display: block;
  width: 100%;
  min-height: 102px;
  max-height: 150px;
  padding: 6px 80px 8px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  border: none;
  border-radius: 6px;
  resize: none;
  outline: none;
  background: transparent;
}

.qq-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  width: 64px;
  height: 28px;
  border: 1px solid #2d7ad4;
  border-radius: 3px;
  background: var(--qq-send);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 50, 120, 0.3);
}

.qq-send:hover {
  filter: brightness(1.05);
}

.qq-send:active { filter: brightness(0.95); }

.qq-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 滚动条 QQ 风格 */
.qq-messages::-webkit-scrollbar,
.qq-groups::-webkit-scrollbar {
  width: 8px;
}

.qq-messages::-webkit-scrollbar-thumb,
.qq-groups::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

/* 代码块与下载 */
.qq-msg-row:not(.self) .qq-bubble {
  max-width: min(92%, 560px);
}

.qq-md-p {
  margin: 0;
  line-height: 1.55;
  word-break: break-word;
}

.qq-md-p strong {
  font-weight: 700;
  color: inherit;
}

.qq-md-p--stream {
  min-height: 1.2em;
}

.qq-bubble-stream-wrap {
  width: 100%;
}

.qq-bubble-text {
  display: block;
  white-space: pre-wrap;
  margin-bottom: 6px;
}

.qq-code-block {
  margin: 8px 0;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  overflow: hidden;
  background: #f6f8fa;
}

.qq-code-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: #eaeef2;
  border-bottom: 1px solid #d0d7de;
}

.qq-code-lang {
  font-size: 11px;
  color: #57606a;
  flex: 1;
}

.qq-code-btn {
  border: 1px solid #c9d1d9;
  background: #fff;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 11px;
  cursor: pointer;
  color: #24292f;
}

.qq-code-btn:hover { background: #f3f4f6; }

.qq-code-btn-run {
  background: #e8f4ff;
  border-color: #7eb8ff;
  color: #1a5fb4;
}

.qq-code-block pre {
  margin: 0;
  padding: 10px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.45;
  font-family: Consolas, "Courier New", monospace;
}

.qq-code-block code { white-space: pre; }

.qq-downloads {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qq-download-btn {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(180deg, #5cadff 0%, #3d96f0 100%);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
}

.qq-download-btn:hover { filter: brightness(1.05); }

.qq-code-deliver {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--qq-divider);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qq-code-deliver-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-qq);
}

.qq-code-deliver-btn--preview {
  background: linear-gradient(180deg, #fff 0%, #f0f7ff 100%);
  color: #1a5fb4;
  border-color: #7eb8fc;
}

.qq-code-deliver-btn--preview:hover {
  background: #e8f4ff;
}

.qq-code-deliver-btn--download {
  background: linear-gradient(180deg, #5cadff 0%, #3d96f0 100%);
  color: #fff;
}

.qq-code-deliver-btn--download:hover {
  filter: brightness(1.06);
}

/* 纯图片消息：无气泡边框，只展示图 */
.qq-bubble.qq-bubble--media-only {
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.qq-msg-row:not(.self) .qq-bubble.qq-bubble--media-only::before,
.qq-msg-row.self .qq-bubble.qq-bubble--media-only::after {
  display: none;
}

.qq-bubble.qq-bubble--has-images .qq-bubble-text {
  margin-bottom: 8px;
}

.qq-media-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 8px;
  max-width: min(100%, 560px);
  overflow-x: auto;
  padding-bottom: 2px;
}

.qq-bubble--has-images .qq-media-strip,
.qq-bubble--media-only .qq-media-strip {
  margin-top: 0;
}

/* 聊天内缩略图（含 AI 生成图）：仅缩小展示，原图 URL 不变，点击放大为全分辨率 */
.qq-media-card {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-top: 8px;
  vertical-align: top;
}

.qq-bubble--media-only .qq-media-card,
.qq-bubble--has-images .qq-media-card {
  margin-top: 0;
}

.qq-media-card-audio {
  min-width: 220px;
  padding-bottom: 4px;
}

.qq-media-dl {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(61, 150, 240, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.qq-media-dl:hover {
  filter: brightness(1.08);
  color: #fff;
}

.qq-media-thumb {
  display: block;
  width: 180px;
  height: 135px;
  max-width: 100%;
  padding: 0;
  box-sizing: border-box;
  border-radius: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  vertical-align: top;
  overflow: hidden;
}

.qq-bubble--media-only .qq-media-thumb,
.qq-bubble--has-images .qq-media-thumb,
.qq-media-strip .qq-media-thumb {
  width: 168px;
  height: 168px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 4px;
}

.qq-media-thumb:hover {
  box-shadow: 0 2px 10px rgba(74, 158, 245, 0.28);
}

.qq-media-thumb .qq-media-preview {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  border: none;
  border-radius: 4px;
  pointer-events: none;
}

.qq-bubble--media-only .qq-media-preview,
.qq-bubble--has-images .qq-media-preview,
.qq-media-strip .qq-media-preview {
  object-fit: cover;
  border-radius: 4px;
}

.qq-media-thumb-video {
  width: 200px;
  height: 112px;
}

.qq-media-thumb-video .qq-media-video {
  background: #111;
}

.qq-media-audio {
  width: 100%;
  min-width: 220px;
}

.qq-media-card-song {
  min-width: 260px;
  max-width: min(100%, 420px);
}

.qq-song-player {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(61, 150, 240, 0.12), rgba(99, 179, 237, 0.08));
  border: 1px solid rgba(61, 150, 240, 0.22);
}

.qq-song-player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.qq-song-player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: rgba(61, 150, 240, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(61, 150, 240, 0.25);
}

.qq-song-player-btn:hover {
  filter: brightness(1.06);
  color: #fff;
}

.qq-song-player-audio {
  display: none;
}

.qq-song-lyrics {
  margin: 0;
}

.qq-song-lyrics > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #2b6cb0;
  user-select: none;
}

.qq-song-lyrics-body {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.qq-bubble--media-only .qq-media-card-song,
.qq-bubble--media-only .qq-media-card-audio,
.qq-bubble--media-only .qq-media-card {
  margin-top: 0;
}

/* 图片放大预览 */
.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-modal[hidden] {
  display: none;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}

.image-preview-panel {
  position: relative;
  z-index: 1;
  max-width: min(94vw, 1200px);
  max-height: min(90vh, 900px);
  margin: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-img,
.image-preview-video {
  max-width: 100%;
  max-height: min(90vh, 860px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.image-preview-img[hidden],
.image-preview-video[hidden] {
  display: none !important;
}

.image-preview-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.image-preview-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* 代码运行弹窗 */
.code-run-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-run-modal[hidden] { display: none; }

.code-run-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.code-run-panel {
  position: relative;
  width: min(92vw, 900px);
  height: min(80vh, 640px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.code-run-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
  font-weight: 600;
}

.code-run-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.code-run-tab {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #444;
}

.code-run-tab.is-active {
  background: #3d96f0;
  border-color: #3d96f0;
  color: #fff;
}

.code-run-copy {
  border: none;
  background: #3d96f0;
  color: #fff;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.code-run-source {
  flex: 1;
  overflow: auto;
  padding: 10px;
  background: #1e1e1e;
}

.code-run-source-block {
  margin: 0;
}

.code-run-source-block pre {
  margin: 0;
  max-height: none;
}

.code-run-source-block code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.qq-code-deliver-btn--copy {
  background: #5a6268;
}

.code-run-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  color: #666;
}

.code-run-frame {
  flex: 1;
  width: 100%;
  border: none;
}

/* 微光任务确认弹窗 */
.qq-task-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qq-task-modal[hidden] {
  display: none;
}

.qq-task-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.qq-task-modal-panel {
  position: relative;
  width: min(92vw, 420px);
  padding: 22px 20px 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.qq-task-modal-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: #222;
}

.qq-task-modal-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
}

.qq-task-modal-countdown {
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
  color: #1a7f4b;
  text-align: center;
}

.qq-task-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.qq-task-btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.qq-task-btn-primary {
  background: #1a7f4b;
  color: #fff;
  border-color: #1a7f4b;
}

.qq-task-btn-ghost {
  background: #f5f5f5;
  color: #444;
  border-color: #ddd;
}

.qq-task-progress {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.qq-task-progress-title {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
}

.qq-task-step {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
  font-size: 12px;
}

.qq-task-step-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.qq-task-step--running .qq-task-step-icon {
  background: #fff3cd;
  color: #856404;
}

.qq-task-step--done .qq-task-step-icon {
  background: #d4edda;
  color: #155724;
}

.qq-task-step--failed .qq-task-step-icon {
  background: #f8d7da;
  color: #721c24;
}

.qq-task-step-title {
  font-weight: 600;
  color: #333;
}

.qq-task-step-detail {
  color: #666;
  margin-top: 2px;
  line-height: 1.4;
  word-break: break-word;
}

.qq-intake-options {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--qq-divider);
}

.qq-intake-group {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e8e8e8;
}

.qq-intake-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.qq-intake-group-label {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
}

.qq-intake-chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.qq-intake-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  padding: 5px 10px;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #c5ddf7;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  color: #1a5fb4;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.qq-intake-chip.is-selected {
  position: relative;
  padding-left: 22px;
  border-color: #1565c0;
  background: linear-gradient(180deg, #4a9ef5 0%, #2b7de9 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(43, 125, 233, 0.45), 0 2px 6px rgba(33, 102, 200, 0.35);
}

.qq-intake-chip.is-selected::before {
  content: "✓";
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.qq-intake-chip.is-selected:hover {
  border-color: #0d47a1;
  background: linear-gradient(180deg, #3d96f0 0%, #1a6fd4 100%);
  color: #fff;
}

.qq-intake-multi-hint {
  margin-top: 6px;
  font-size: 10px;
  color: #888;
  line-height: 1.3;
}

.qq-intake-group-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.qq-intake-confirm-btn,
.qq-intake-skip-btn {
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #9ec5ef;
  background: #f0f7ff;
  color: #1a5fb4;
}

.qq-intake-skip-btn {
  border-color: #ccc;
  background: #fafafa;
  color: #666;
}

.qq-intake-group--optional .qq-intake-group-label {
  color: #666;
  font-weight: 500;
}

.qq-intake-group--done {
  opacity: 0.72;
  pointer-events: none;
}

.qq-intake-group--done .qq-intake-chip.is-selected {
  opacity: 1;
}

.qq-intake-chip:hover {
  border-color: #4a9ef5;
  background: #e3f1ff;
  box-shadow: 0 1px 4px rgba(74, 158, 245, 0.2);
}

.qq-intake-chip:active {
  transform: translateY(1px);
}

.qq-intake-options[data-contact-id="office"] .qq-intake-chip {
  border-color: #b7dfc4;
  color: #1b6b3a;
  background: linear-gradient(180deg, #f6fff9 0%, #eaf8ef 100%);
}

.qq-intake-options[data-contact-id="office"] .qq-intake-chip:hover {
  border-color: #3d9b5c;
  background: #dff5e8;
}

.qq-intake-options[data-contact-id="office"] .qq-intake-chip.is-selected {
  border-color: #1a6b38;
  background: linear-gradient(180deg, #42a86a 0%, #2d8a4e 100%);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(45, 138, 78, 0.55), 0 2px 6px rgba(30, 110, 60, 0.35);
}

.qq-intake-options[data-contact-id="office"] .qq-intake-chip.is-selected:hover {
  background: linear-gradient(180deg, #3d9b5c 0%, #267a42 100%);
  color: #fff;
}

.qq-intake-options[data-contact-id="weiguang"] .qq-intake-chip {
  border-color: #d4c4f7;
  color: #5b21b6;
  background: linear-gradient(180deg, #faf7ff 0%, #f3edff 100%);
}

.qq-intake-options[data-contact-id="weiguang"] .qq-intake-chip:hover {
  border-color: #9333ea;
  background: #ede4ff;
}

.qq-intake-options[data-contact-id="weiguang"] .qq-intake-chip.is-selected {
  border-color: #6b21a8;
  background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.45), 0 2px 6px rgba(107, 33, 168, 0.35);
}

.qq-intake-options[data-contact-id="paint"] .qq-intake-chip.is-selected,
.qq-intake-options[data-contact-id="video"] .qq-intake-chip.is-selected,
.qq-intake-options[data-contact-id="song"] .qq-intake-chip.is-selected,
.qq-intake-options[data-contact-id="writing"] .qq-intake-chip.is-selected,
.qq-intake-options[data-contact-id="legal"] .qq-intake-chip.is-selected,
.qq-intake-options[data-contact-id="emotion"] .qq-intake-chip.is-selected,
.qq-intake-options[data-contact-id="code"] .qq-intake-chip.is-selected {
  border-color: #1565c0;
  background: linear-gradient(180deg, #4a9ef5 0%, #2b7de9 100%);
  color: #fff;
}

@media (max-width: 640px) {
  .qq-sidebar { width: 72px; }
  .qq-contact-info { display: none; }
  .qq-group-title { font-size: 0; padding: 4px; }
  .qq-group-title::before { margin: 0 auto; }
  .qq-contact { justify-content: center; padding: 8px 4px; }
}

/* 微光窗 — 专精导购卡片（方案 C 一键填入） */
.qq-studio-advice {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.qq-studio-advice-params {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0 0 10px;
  font-size: 12px;
}

.qq-studio-advice-params dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

.qq-studio-advice-params dd {
  margin: 0;
  color: #0f172a;
}

.qq-studio-advice-prompt {
  margin-bottom: 10px;
}

.qq-studio-advice-prompt-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.qq-studio-advice-prompt-text {
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
}

.qq-studio-advice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qq-studio-advice-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.qq-studio-advice-btn:hover {
  background: #f1f5f9;
}

.qq-studio-advice-btn-primary {
  border-color: #2563eb;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
}

.qq-studio-advice-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
