/* ==================== 聊天页面布局 ==================== */
.app-layout {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

/* ==================== 侧边栏样式 ==================== */
.sidebar {
    width: 260px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    position: relative;
    overflow: visible;
    margin: 0.3rem 0 0.3rem 0.3rem;
}

.sidebar-header {
    flex-direction: column;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem;
}

.sidebar-controls .sidebar-btn:not(#sidebar-toggle-btn) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-controls #sidebar-toggle-btn {
    margin-left: auto;
}

/* 侧边栏折叠时隐藏向左的按钮 */
.app-layout.sidebar-collapsed #sidebar-toggle-btn {
    display: none;
}

/* 侧边栏关闭时显示打开按钮 */
.app-layout.sidebar-collapsed .sidebar-toggle-collapsed {
    display: block;
}

.app-layout.sidebar-collapsed .sidebar {
    width: 0;
    padding: 0;
    margin: 0;
    border-right: none;
    overflow: hidden;
}

/* 侧边栏中部 */
.sidebar-middle {
    display: flex;
    justify-content: center;
    flex: none;
}

.sidebar-middle:not(.sidebar-header .sidebar-middle) {
    flex: 1;
    overflow-y: auto;
}

/* ==================== 对话列表样式 ==================== */
.conversation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem;
    border-radius: 4px;
    background-color: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.conversation-item:hover {
    background-color: var(--hover-bg);
}

.conversation-item.active {
    background-color: var(--highlight-bg);
    color: var(--accent-color);
    font-weight: 600;
}

.conversation-item-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 1;
}

.conversation-item-actions {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    right: 0.5rem;
    border-radius: 3px;
    z-index: 2;
}

.conversation-item:hover .conversation-item-actions {
    opacity: 1;
}

.conversation-item-action-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-item-action-btn:hover {
    background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
    color: var(--accent-color);
}

.conversation-item-action-btn.lock-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.conversation-item-action-btn.lock-btn.locked {
    color: #3498db;
    font-weight: bold;
}

.conversation-item-action-btn.clear-btn:hover {
    background-color: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.conversation-item-action-btn.close-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.conversation-item-edit {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    width: 100%;
}

.conversation-item-edit-input {
    flex: 1;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.conversation-item-edit-input:focus {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 25%, transparent);
    border-color: var(--accent-color);
    background: var(--content-bg);
}

.conversation-item-edit-confirm,
.conversation-item-edit-cancel {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.conversation-item-edit-confirm:hover {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.conversation-item-edit-cancel:hover {
    background-color: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

/* 侧边栏底部按钮区域 */
.sidebar-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
}

/* ==================== 主要内容区域 ==================== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: transparent;
}

.panels-area {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-width: 0;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-color);
}

.panels-container {
    display: flex;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.3rem;
    gap: 0.3rem;
}

.panels-container:not(:empty) {
    flex: 1;
}

/* ==================== 聊天面板样式 ==================== */
.chat-panel {
    flex: 1;
    min-width: 300px;
    min-height: 0;
    background-color: var(--content-bg);
    border-radius: 8px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background-color: var(--header-bg);
    color: white;
    padding: 0.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 2.5rem;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.panel-title {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.panel-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
    order: 2;
}

.panel-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.95rem;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.panel-actions button:hover {
    background-color: var(--hover-bg);
    transform: scale(1.15);
}

.panel-actions button:active {
    filter: brightness(0.92);
}

.panel-actions button.close-btn {
    order: 10;
    flex-shrink: 0;
}

.panel-actions button:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 分屏标题中的模型下拉框样式 */
.panel-header .model-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    color: #fff;
    border: none;
    padding: 0.25rem 1.75rem 0.25rem 0.25rem;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px 12px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

.panel-header .model-select:focus {
    outline: none;
}

/* 模型变体下拉，风格与 provider 一致但稍弱化 */
.panel-header .model-variant-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    color: #fff;
    border: none;
    margin-left: 1rem;
    padding: 0.25rem 1.75rem 0.25rem 0.25rem;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px 12px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

.panel-header .model-variant-select:focus {
    outline: none;
}

/* 修正下拉列表弹出为白底时文字不可见：强制选项使用主题文字/背景色 */
.panel-header .model-select option,
.panel-header .model-variant-select option {
    color: var(--text-color);
    background-color: var(--content-bg);
}

.panel-content {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ==================== 消息样式 ==================== */
.message {
    padding: 0.75rem;
    border-radius: 8px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.user-message {
    background-color: var(--hover-bg);
    align-self: flex-end;
}

.ai-message {
    background-color: var(--hover-bg);
    align-self: flex-start;
}

.system-message {
    background-color: var(--hover-bg);
    align-self: flex-end;
}

/* 持久化错误消息气泡样式 */
.message.error-bubble {
    background-color: color-mix(in srgb, #e53935 10%, var(--content-bg));
    border: 1px solid color-mix(in srgb, #e53935 25%, transparent);
    color: #e53935;
}

.message-header {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--muted-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-message .message-header {
    flex-direction: row-reverse;
}

/* 思考内容样式 */
.message-think {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--hover-bg);
    position: relative;
    overflow: hidden;
}

.think-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: color-mix(in srgb, var(--border-color) 10%, transparent);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--muted-text);
    position: relative;
}

.think-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-text);
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.think-toggle-btn:hover {
    background: rgba(0,0,0,0.06);
    color: var(--text-color);
}

.think-content {
    padding: 0 0.75rem 0.75rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: pre-wrap;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.message-think.expanded .think-content {
    max-height: none;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* 折叠状态下的思考内容预览 */
.think-preview {
    position: absolute;
    left: 5rem;
    right: 5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.message-think.expanded .think-preview {
    opacity: 0;
    pointer-events: none;
}

@keyframes typing-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.think-toggle-icon {
    transition: transform 0.3s ease;
}

.message-think.expanded .think-toggle-icon {
    transform: rotate(180deg);
}

.message-content {
    white-space: pre-wrap;
    overflow-x: auto;
}

.user-message .message-content {
    text-align: left;
    display: flex;
    justify-content: flex-end;
}

/* Markdown 样式细化 */
.message-content ul,
.message-content ol {
    padding-left: 3rem;
    list-style-position: outside;
    white-space: normal;
}

/* 表格样式 */
.message-content table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 1rem 0;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--content-bg);
}

.message-content th,
.message-content td {
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

.message-content th {
    background-color: color-mix(in srgb, var(--border-color) 20%, transparent);
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.message-content td {
    background-color: var(--content-bg);
}

.message-content tr:nth-child(even) td {
    background-color: var(--hover-bg);
}

/* 确保表格第一行和最后一行的边框与表格外框对齐 */
.message-content tr:first-child th:first-child {
    border-top-left-radius: 5px;
}
.message-content tr:first-child th:last-child {
    border-top-right-radius: 5px;
}
.message-content tr:last-child td:first-child {
    border-bottom-left-radius: 5px;
}
.message-content tr:last-child td:last-child {
    border-bottom-right-radius: 5px;
}

.message-content pre {
    border-radius: 6px;
    padding: 12px;
    overflow: auto;
    position: relative;
}

/* 浅色主题代码块背景 */
:root[data-effective-mode="light"] .message-content pre {
    background-color: #f6f8fa;
}

/* 深色主题代码块背景 */
:root[data-effective-mode="dark"] .message-content pre {
    background-color: #161b22;
}

/* Prism.js 主题切换 */
:root[data-effective-mode="light"] #prism-dark-theme {
    display: none;
}

:root[data-effective-mode="dark"] #prism-dark-theme {
    display: block;
}

/* 确保代码块样式与 Prism 主题兼容 */
.message-content pre[class*="language-"] {
    padding: 12px;
    border-radius: 6px;
    overflow: auto;
    position: relative;
    margin: 1rem 0;
}

/* 调整代码块内边距以适应复制按钮 */
.message-content pre[class*="language-"] code {
    padding-right: 40px;
}

/* 确保 Prism 主题下的代码块样式正确 */
.message-content pre[class*="language-"] {
    background-color: var(--code-bg, #f6f8fa);
    border: 1px solid var(--border-color);
}

/* 代码块复制按钮 */
.code-copy-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 4px 4px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0.5;
    color: inherit;
    white-space: nowrap;
}

.code-copy-btn:hover {
    opacity: 1;
    background: rgba(120, 120, 120, 0.15);
}

.code-copy-btn:active {
    transform: scale(0.9);
}

.code-copy-btn.copied {
    opacity: 1;
    color: #27ae60;
}

/* 仅针对行内代码添加轻微底色，预格式化块内的 code 不需要单独背景 */
.message-content :not(pre) > code {
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 4px;
    padding: 0.2em 0.4em;
}

/* 去除代码块内文字本身的背景，避免出现"被选中"的感觉 */
.message-content pre code {
    background: transparent !important;
    padding: 0 !important;
}

.msg-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted-text);
    font-size: 0.75rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.msg-toggle-btn:hover {
    background: rgba(0,0,0,0.06);
    color: var(--text-color);
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-text);
    font-style: italic;
}

.dot-flashing {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: var(--accent-color);
    color: var(--accent-color);
    animation: dotFlashing 1s infinite linear alternate;
    animation-delay: 0.5s;
}

.dot-flashing::before, .dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
}

.dot-flashing::before {
    left: -15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: var(--accent-color);
    color: var(--accent-color);
    animation: dotFlashing 1s infinite alternate;
    animation-delay: 0s;
}

.dot-flashing::after {
    left: 15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: var(--accent-color);
    color: var(--accent-color);
    animation: dotFlashing 1s infinite alternate;
    animation-delay: 1s;
}

@keyframes dotFlashing {
    0% {
        background-color: var(--accent-color);
    }
    50%, 100% {
        background-color: var(--border-color);
    }
}

/* ==================== 空闲状态样式 ==================== */
.panels-empty {
    display: none;
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    right: 0.3rem;
    bottom: 0.3rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 5;
}

.panels-empty.show {
    display: flex;
}

.panels-empty-content {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.panels-empty-content h2 {
    color: var(--muted-text);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.panels-empty-content p {
    color: color-mix(in srgb, var(--text-color) 60%, var(--bg-color));
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* ==================== 输入区域样式 ==================== */
.input-area {
    padding: 0 0.3rem 0.3rem 0.3rem;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    max-height: 50vh;
    position: relative;
}

.input-resize-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    flex-shrink: 0;
    gap: 3px;
    position: relative;
    background: transparent;
}

.input-resize-handle::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--resize-handle-color);
    position: absolute;
    left: 50%;
    transform: translateX(-8px);
}

.input-resize-handle::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--resize-handle-color);
    position: absolute;
    left: 50%;
    transform: translateX(4px);
}

.input-resize-handle .dot-middle {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--resize-handle-color);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0.25rem;
    gap: 0.3rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    margin: 0;
}

#message-input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    resize: none;
    min-height: 60px;
    font-family: inherit;
    overflow-y: auto;
    background: transparent;
    color: var(--text-color);
    caret-color: var(--text-color);
}

#message-input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.input-button-bar {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.button-group-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#send-button {
    background: none;
    color: var(--text-color);
    border: none;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.95rem;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#send-button:hover {
    background-color: var(--hover-bg);
    transform: scale(1.15);
}

.add-panel-btn {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-panel-btn:hover {
    background-color: color-mix(in srgb, var(--accent-color) 85%, black);
}

/* ==================== 响应式设计（所有@media查询统一放在文件底部）==================== */

/* 平板和中等屏幕 */
@media (max-width: 768px) {
    /* 防止横向滚动 */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    .container {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-layout {
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
    }

    /* 移动端侧边栏样式 */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 1200;
        margin: 0;
        border-radius: 0;
        border-right: 1px solid var(--border-color);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    /* 侧边栏显示状态 */
    .app-layout.sidebar-mobile-visible .sidebar {
        transform: translateX(0);
    }

    /* 移动端遮罩层 */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1199;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .app-layout.sidebar-mobile-visible .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* 移动端打开按钮始终显示 */
    .sidebar-toggle-collapsed {
        display: block !important;
    }

    /* 移动端：侧边栏显示时也显示向左的半圆按钮 */
    .app-layout.sidebar-mobile-visible .sidebar {
        transform: translateX(0);
    }

    /* 移动端：对话条目上的按钮始终可见 */
    .conversation-item-actions {
        opacity: 1;
        position: static;
        right: auto;
    }

    /* 移动端：panel标题栏按钮按优先级显示 */
    /* 默认显示所有按钮 */
    .panel-actions button {
        display: flex;
    }

    /* 桌面端的折叠状态在移动端不适用 */
    .app-layout.sidebar-collapsed .sidebar {
        width: 280px;
        max-width: 85vw;
        padding: 0.5rem;
        transform: translateX(-100%);
    }

    /* 面板容器垂直排列 */
    .panels-container {
        flex-direction: column;
        overflow-x: hidden;
    }

    /* 聊天面板自适应宽度 */
    .chat-panel {
        min-width: 100%;
        width: 100%;
    }

    /* 主内容区域 */
    .main-area {
        width: 100%;
        overflow-x: hidden;
    }

    /* 输入区域 */
    .input-area {
        width: 100%;
        max-width: 100%;
    }

    .input-wrapper {
        width: 100%;
        max-width: 100%;
    }
}

/* Panel 按钮响应式显示优先级 - 中等屏幕 */
@media (max-width: 600px) {
    /* 隐藏配置按钮 */
    .panel-actions button.config-btn {
        display: none;
    }
}

/* Panel 按钮响应式显示优先级 - 较小屏幕 */
@media (max-width: 500px) {
    /* 隐藏清除按钮 */
    .panel-actions button.clear-panel-btn {
        display: none;
    }
}

/* 小屏幕手机 */
@media (max-width: 480px) {
    .sidebar {
        width: 260px;
        max-width: 80vw;
    }

    .sidebar {
        padding: 0.3rem;
    }

    /* 小屏幕：对话条目按钮样式优化 */
    .conversation-item-action-btn {
        padding: 0.15rem 0.25rem;
        font-size: 0.75rem;
    }

    /* 小屏幕：panel标题栏按钮样式优化 */
    .panel-header {
        padding: 0.4rem;
        flex-wrap: wrap;
    }

    .panel-actions button {
        padding: 0.25rem 0.3rem;
        font-size: 0.85rem;
        min-width: 20px;
        height: 20px;
    }

    .input-area {
        padding: 0 0.2rem 0.2rem 0.2rem;
        min-height: 100px;
    }

    .chat-panel {
        min-width: 100%;
    }
}
