Qwen Chat: Wide Layout + Wider Scrollbar + Sticky Code Buttons

Removes max-width, stretches the chat, increases the scrollbar width, and makes the code copy buttons sticky.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Qwen Chat: Wide Layout + Wider Scrollbar + Sticky Code Buttons
// @name:ru      Qwen Chat: Широкий макет + толстая прокрутка + липкие кнопки кода
// @namespace    http://tampermonkey.net/
// @version      1.0
// @author       a114_you
// @description     Removes max-width, stretches the chat, increases the scrollbar width, and makes the code copy buttons sticky.
// @description:ru  Убирает max-width, растягивает чат, увеличивает ширину полосы прокрутки и делает кнопки копирования кода липкими
// @match        https://chat.qwen.ai/*
// @grant        none
// @run-at       document-start
// @license MIT
// ==/UserScript==

(function(){
  'use strict';
  const css = `
    /* === 1. Убираем ограничения по ширине всей страницы === */
    html, body {
      width: 100vw !important;
      max-width: 100vw !important;
      overflow-x: hidden !important;
    }

    /* === 2. Отключаем автоматическое центрирование (mx-auto) === */
    .mx-auto {
      margin-left: 0 !important;
      margin-right: 0 !important;
    }

    /* === 3. Основная область чата: увеличиваем на всю ширину === */
    #chat-message-container,
    #chat-message-container > div,
    #messages-container {
      width: 100% !important;
      max-width: none !important; /* ← поставьте здесь нужное ограничение, например max-width:1400px */
    }

    /* === 4. Убираем боковые отступы у pane-контейнера === */
    [data-pane] {
      padding-left: 0 !important;
      padding-right: 0 !important;
    }

    /* === 5. «Прилипание» панели копирования/загрузки кода === */
    .copy.top-8 {
      position: sticky !important;
      top: 0 !important;
      background: inherit !important; /* не перекрывать фон */
      z-index: 10 !important;          /* поверх кода */
    }

    /* === 6. Скроллбар: Firefox === */
    #messages-container {
      scrollbar-width: auto !important; /* thin | auto | none */
      scrollbar-color: rgba(150,150,150,0.5) transparent !important;
    }
        /* === 7. Растягиваем поле ввода по всей ширине === */
//     .chat-message-input-textarea-container-pc,
//     .chat-message-input-container-inner,
//     #chat-input {
//       width: 100% !important;
//       max-width: none !important;
//     }

  `;
  const style = document.createElement('style');
  style.textContent = css;
  document.documentElement.appendChild(style);
})();