/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #666;
    --bg-color: #f5f5f5;
    --sidebar-bg: #fff;
    --chat-bg: #fff;
    --border-color: #e5e5e5;
    --hover-bg: #f0f0f0;
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --message-user-bg: #4f46e5;
    --message-bot-bg: #f3f4f6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
    overflow: hidden;
}

/* 应用容器 */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.logo svg {
    width: 28px;
    height: 28px;
    color: var(--accent-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'%3E%3Ccircle cx='32' cy='32' r='30' fill='%231a1a1a' stroke='%23333' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='26' fill='none' stroke='%23444' stroke-width='1' stroke-dasharray='4 2'/%3E%3Ccircle cx='32' cy='32' r='22' fill='none' stroke='%23555' stroke-width='1' stroke-dasharray='3 3'/%3E%3Ccircle cx='32' cy='32' r='14' fill='%23667eea' stroke='%235a67d8' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='8' fill='%23764ba2'/%3E%3Ccircle cx='32' cy='32' r='4' fill='%231a1a1a'/%3E%3Cpath d='M32 4 L32 18 M32 46 L32 60 M4 32 L18 32 M46 32 L60 32 M12.7 12.7 L22.6 22.6 M41.4 41.4 L51.3 51.3 M12.7 51.3 L22.6 41.4 M41.4 22.6 L51.3 12.7' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='32' cy='22' r='2' fill='%23ccc'/%3E%3Ccircle cx='32' cy='42' r='2' fill='%23ccc'/%3E%3Ccircle cx='22' cy='32' r='2' fill='%23ccc'/%3E%3Ccircle cx='42' cy='32' r='2' fill='%23ccc'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    border-radius: 50%;
    animation: tire-roll 3s linear infinite;
}

.new-chat-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: var(--accent-hover);
}

.new-chat-btn svg {
    width: 16px;
    height: 16px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    transition: background 0.2s;
    font-size: 14px;
    color: var(--secondary-color);
}

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

.history-item:hover .delete-chat-btn {
    opacity: 1;
}

.history-item.active {
    background: #eef2ff;
    color: var(--accent-color);
}

.history-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.history-item-content svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.history-item-content span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-chat-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--secondary-color);
    opacity: 0;
    transition: all 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-chat-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.delete-chat-btn svg {
    width: 14px;
    height: 14px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-info:hover {
    background: var(--hover-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--hover-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar svg {
    width: 18px;
    height: 18px;
    color: var(--secondary-color);
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: var(--secondary-color);
    transition: transform 0.2s;
}

.user-info.active .dropdown-icon {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    background: var(--chat-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

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

.dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.logout-btn {
    color: #dc2626;
}

.logout-btn svg {
    color: #dc2626;
}

/* 主聊天区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    min-width: 0;
}

/* 顶部导航 */
.chat-header {
    height: 60px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--chat-bg);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: var(--hover-bg);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
}

.current-chat-title {
    font-size: 16px;
    font-weight: 600;
}

.quota-indicator {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    margin-right: 12px;
}
.quota-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}
.quota-link:hover { text-decoration: underline; }

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    transition: all 0.2s;
    text-decoration: none;
    padding: 0 10px;
    gap: 6px;
}

.header-btn:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.header-btn svg {
    width: 18px;
    height: 18px;
}

.header-btn span {
    font-size: 14px;
}

/* 欢迎界面 */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.welcome-avatar svg {
    width: 40px;
    height: 40px;
    color: white;
}

.welcome-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'%3E%3Ccircle cx='32' cy='32' r='30' fill='%231a1a1a' stroke='%23333' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='26' fill='none' stroke='%23444' stroke-width='1' stroke-dasharray='4 2'/%3E%3Ccircle cx='32' cy='32' r='22' fill='none' stroke='%23555' stroke-width='1' stroke-dasharray='3 3'/%3E%3Ccircle cx='32' cy='32' r='14' fill='%23667eea' stroke='%235a67d8' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='8' fill='%23764ba2'/%3E%3Ccircle cx='32' cy='32' r='4' fill='%231a1a1a'/%3E%3Cpath d='M32 4 L32 18 M32 46 L32 60 M4 32 L18 32 M46 32 L60 32 M12.7 12.7 L22.6 22.6 M41.4 41.4 L51.3 51.3 M12.7 51.3 L22.6 41.4 M41.4 22.6 L51.3 12.7' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='32' cy='22' r='2' fill='%23ccc'/%3E%3Ccircle cx='32' cy='42' r='2' fill='%23ccc'/%3E%3Ccircle cx='22' cy='32' r='2' fill='%23ccc'/%3E%3Ccircle cx='42' cy='32' r='2' fill='%23ccc'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    border-radius: 50%;
    animation: tire-roll 3s linear infinite;
    margin: 0 auto;
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 40px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-btn {
    padding: 16px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
}

.quick-btn:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.quick-icon {
    font-size: 24px;
}

/* 消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: none;
}

.chat-messages.active {
    display: block;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 流式消息样式 */
.message.streaming .message-content {
    position: relative;
}

.message.streaming .streaming-content::after {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    margin-left: 10px;
    vertical-align: middle;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'%3E%3C!-- 外轮胎 --%3E%3Ccircle cx='32' cy='32' r='30' fill='%231a1a1a' stroke='%23333' stroke-width='2'/%3E%3C!-- 轮胎纹理 --%3E%3Ccircle cx='32' cy='32' r='26' fill='none' stroke='%23444' stroke-width='1' stroke-dasharray='4 2'/%3E%3Ccircle cx='32' cy='32' r='22' fill='none' stroke='%23555' stroke-width='1' stroke-dasharray='3 3'/%3E%3C!-- 轮毂外圈 --%3E%3Ccircle cx='32' cy='32' r='14' fill='%23667eea' stroke='%235a67d8' stroke-width='2'/%3E%3C!-- 轮毂内圈 --%3E%3Ccircle cx='32' cy='32' r='8' fill='%23764ba2'/%3E%3C!-- 中心孔 --%3E%3Ccircle cx='32' cy='32' r='4' fill='%231a1a1a'/%3E%3C!-- 轮辐 --%3E%3Cpath d='M32 4 L32 18 M32 46 L32 60 M4 32 L18 32 M46 32 L60 32 M12.7 12.7 L22.6 22.6 M41.4 41.4 L51.3 51.3 M12.7 51.3 L22.6 41.4 M41.4 22.6 L51.3 12.7' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3C!-- 螺丝孔 --%3E%3Ccircle cx='32' cy='22' r='2' fill='%23ccc'/%3E%3Ccircle cx='32' cy='42' r='2' fill='%23ccc'/%3E%3Ccircle cx='22' cy='32' r='2' fill='%23ccc'/%3E%3Ccircle cx='42' cy='32' r='2' fill='%23ccc'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: tire-roll 1.2s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@keyframes tire-roll {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'%3E%3Ccircle cx='32' cy='32' r='30' fill='%231a1a1a' stroke='%23333' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='26' fill='none' stroke='%23444' stroke-width='1' stroke-dasharray='4 2'/%3E%3Ccircle cx='32' cy='32' r='22' fill='none' stroke='%23555' stroke-width='1' stroke-dasharray='3 3'/%3E%3Ccircle cx='32' cy='32' r='14' fill='%23667eea' stroke='%235a67d8' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='8' fill='%23764ba2'/%3E%3Ccircle cx='32' cy='32' r='4' fill='%231a1a1a'/%3E%3Cpath d='M32 4 L32 18 M32 46 L32 60 M4 32 L18 32 M46 32 L60 32 M12.7 12.7 L22.6 22.6 M41.4 41.4 L51.3 51.3 M12.7 51.3 L22.6 41.4 M41.4 22.6 L51.3 12.7' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='32' cy='22' r='2' fill='%23ccc'/%3E%3Ccircle cx='32' cy='42' r='2' fill='%23ccc'/%3E%3Ccircle cx='22' cy='32' r='2' fill='%23ccc'/%3E%3Ccircle cx='42' cy='32' r='2' fill='%23ccc'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: tire-roll 3s linear infinite;
}

.user-message .message-avatar {
    background: var(--accent-color);
    order: 2;
}

.message-avatar svg {
    width: 20px;
    height: 20px;
    color: white;
}

.bot-message .message-avatar svg {
    display: none;
}

.message-content {
    max-width: calc(100% - 60px);
    padding: 0;
}

.bot-message .message-content {
    background: transparent;
}

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

.user-message .message-content {
    background: var(--message-user-bg);
    color: white;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
}

/* Markdown 样式 */
.markdown-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--primary-color);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.markdown-body h1 {
    font-size: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-body h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.markdown-body h3 {
    font-size: 18px;
}

.markdown-body p {
    margin-bottom: 12px;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
}

.markdown-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--secondary-color);
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
}

.markdown-body th {
    background: #f9fafb;
    font-weight: 600;
}

.markdown-body tr:nth-child(even) {
    background: #f9fafb;
}

.markdown-body tr:hover {
    background: #f3f4f6;
}

.markdown-body a {
    color: var(--accent-color);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

/* 输入区域 */
.chat-input-area {
    padding: 20px;
    background: var(--chat-bg);
    border-top: 1px solid var(--border-color);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.file-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
}

.file-preview .file-icon {
    font-size: 16px;
}

.file-preview .file-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview .remove-file {
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--secondary-color);
}

.file-preview .remove-file:hover {
    background: #e5e5e5;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f3f4f6;
    border-radius: 16px;
    padding: 8px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    background: white;
}

.upload-actions {
    display: flex;
    gap: 4px;
}

.upload-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    transition: all 0.2s;
    flex-shrink: 0;
}

.upload-btn:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.upload-btn svg {
    width: 20px;
    height: 20px;
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    max-height: 200px;
    min-height: 24px;
    padding: 8px 4px;
    outline: none;
    font-family: inherit;
}

#messageInput::placeholder {
    color: #9ca3af;
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--accent-color);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

.input-footer {
    margin-top: 8px;
    text-align: center;
}

.hint {
    font-size: 12px;
    color: #9ca3af;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* 错误消息 */
.error-message {
    background: #fef2f2 !important;
    border: 1px solid #fecaca;
}

.error-message p {
    color: #dc2626 !important;
}

/* 图片预览 */
.image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    margin: 8px 0;
}

.message-image {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .chat-messages {
        padding: 12px;
    }

    .message-content {
        max-width: calc(100% - 50px);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--hover-bg);
    border-radius: 8px;
    margin-top: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info .username {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
}

.logout-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #fee;
    border-color: #fcc;
    color: #c33;
}

/* ============ Stream Loading Animation ============ */
.stream-loading {
    padding: 12px 0;
}

.stream-loading-bar {
    width: 100%;
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.stream-loading-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #667eea, #a78bfa, #764ba2, transparent);
    animation: shimmer-sweep 0.7s linear infinite;
}

@keyframes shimmer-sweep {
    0% { left: -40%; }
    100% { left: 100%; }
}

.stream-loading-text {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
    animation: pulse-text 1.2s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============ Streaming Answer ============ */
.stream-answer {
    font-size: 15px;
    line-height: 1.8;
    color: var(--primary-color);
}

/* ============ Streaming Cursor (rotating tire) ============ */
.stream-cursor {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    vertical-align: middle;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'%3E%3Ccircle cx='32' cy='32' r='30' fill='%231a1a1a' stroke='%23333' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='26' fill='none' stroke='%23444' stroke-width='1' stroke-dasharray='4 2'/%3E%3Ccircle cx='32' cy='32' r='22' fill='none' stroke='%23555' stroke-width='1' stroke-dasharray='3 3'/%3E%3Ccircle cx='32' cy='32' r='14' fill='%23667eea' stroke='%235a67d8' stroke-width='2'/%3E%3Ccircle cx='32' cy='32' r='8' fill='%23764ba2'/%3E%3Ccircle cx='32' cy='32' r='4' fill='%231a1a1a'/%3E%3Cpath d='M32 4 L32 18 M32 46 L32 60 M4 32 L18 32 M46 32 L60 32 M12.7 12.7 L22.6 22.6 M41.4 41.4 L51.3 51.3 M12.7 51.3 L22.6 41.4 M41.4 22.6 L51.3 12.7' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='32' cy='22' r='2' fill='%23ccc'/%3E%3Ccircle cx='32' cy='42' r='2' fill='%23ccc'/%3E%3Ccircle cx='22' cy='32' r='2' fill='%23ccc'/%3E%3Ccircle cx='42' cy='32' r='2' fill='%23ccc'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: tire-roll 0.8s linear infinite;
}
