/**
 * ========================================
 * AI Chat - 黑客帝国风格聊天界面 v2.3
 * Matrix Theme Chat Style - UI/UX Enhanced
 * ========================================
 * 优化版：简洁设计 + 移动端完美适配 + 无障碍支持
 * ========================================
 */

/* ===== 黑客帝国色彩变量 ===== */
:root {
    /* 主色调 - 更高对比度 */
    --matrix-green: #00ff00;
    --matrix-green-dark: #00cc00;
    --matrix-green-light: #00ff41;
    --matrix-green-glow: rgba(0, 255, 0, 0.5);
    --matrix-green-dim: #008800;
    --matrix-green-fade: rgba(0, 255, 0, 0.1);

    /* 背景色 - 深色优化 */
    --matrix-black: #000000;
    --matrix-dark: #0a0a0a;
    --matrix-darker: #050505;
    --matrix-gray-dark: #001a00;
    --matrix-gray: #003300;

    /* 文字色 - 提高可读性 */
    --text-primary: #00ff00;
    --text-secondary: #00cc00;
    --text-dim: #00aa00;
    --text-muted: #008800;

    /* 边框色 */
    --border-color: #00ff00;
    --border-glow: rgba(0, 255, 0, 0.3);

    /* 字体 */
    --font-mono: 'Courier New', 'Consolas', 'Monaco', monospace;

    /* 阴影 - 优化性能 */
    --shadow-glow: 0 0 10px var(--matrix-green-glow);
    --shadow-glow-strong: 0 0 20px var(--matrix-green-glow);

    /* 动画时长 - 符合 UX 最佳实践 */
    --transition-fast: 150ms;
    --transition-normal: 200ms;
    --transition-slow: 300ms;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-mono);
    background-color: var(--matrix-black);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    /* 防止iOS橡皮筋效果 */
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

/* ===== 焦点可见性 - 无障碍支持 ===== */
:focus-visible {
    outline: 2px solid var(--matrix-green);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--matrix-green-light);
    outline-offset: 2px;
}

/* ===== 矩阵雨背景 ===== */
#matrix-canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 移动端降低矩阵雨性能 */
@media (max-width: 768px) {
    #matrix-canvas {
        opacity: 0.4;
    }
}

/* ===== 扫描线效果 ===== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    /* 移动端可选关闭 */
}

@media (max-width: 768px) {
    .scanlines {
        display: none;
    }
}

/* ===== 减弱动画支持 - 无障碍 ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .scanline-bar {
        animation: none;
    }

    #matrix-canvas {
        opacity: 0.3;
    }
}

.scanline-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--matrix-green) 50%,
        transparent 100%
    );
    opacity: 0.3;
    animation: scanline 6s linear infinite;
    z-index: 999;
    pointer-events: none;
}

@keyframes scanline {
    0% { transform: translateY(-2px); }
    100% { transform: translateY(100vh); }
}

/* ===== 主容器 ===== */
#app {
    display: flex;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 1;
}

/* ===== 侧边栏遮罩层 ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 280px;
    background: rgba(0, 10, 0, 0.95);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition-normal) var(--transition-easing);
    z-index: 999;
    backdrop-filter: blur(10px);
}

/* ===== Logo 区域 ===== */
.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--matrix-green-dim);
    background: rgba(0, 20, 0, 0.8);
}

.sidebar-header .logo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green);
    letter-spacing: 1px;
}

.sidebar-header .tagline {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-top: 2px;
}

/* ===== 侧边栏标签样式 ===== */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--matrix-green-dim);
    background: rgba(0, 15, 0, 0.9);
}

.sidebar-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-fast) var(--transition-easing);
    border-bottom: 2px solid transparent;
    font-family: var(--font-mono);
    position: relative;
}

.sidebar-tab:hover {
    color: var(--matrix-green);
    background: rgba(0, 255, 0, 0.05);
}

.sidebar-tab:focus {
    outline: none;
    background: rgba(0, 255, 0, 0.08);
}

.sidebar-tab.active {
    color: var(--matrix-green);
    border-bottom-color: var(--matrix-green);
    background: rgba(0, 255, 0, 0.1);
}

.sidebar-tab i {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

/* ===== 标签内容区域 ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== 提示词区域 ===== */
.prompt-section {
    padding: 16px;
    border-bottom: 1px solid var(--matrix-green-dim);
    max-height: 50vh;
    overflow-y: auto;
}

.prompt-section h3 {
    margin: 0 0 10px 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--matrix-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prompt-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

/* ===== 按钮基础样式 ===== */
.prompt-btn,
.agent-btn {
    padding: 8px 10px;
    background: var(--matrix-gray-dark);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    font-size: 0.7rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast) var(--transition-easing);
    font-family: var(--font-mono);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
    /* 确保触摸目标足够大 */
    min-height: 44px;
}

.prompt-btn i,
.agent-btn i {
    font-size: 0.8rem;
    width: 14px;
    text-align: center;
    opacity: 0.7;
    flex-shrink: 0;
}

.prompt-btn:hover,
.agent-btn:hover {
    background: var(--matrix-gray);
    color: var(--matrix-green);
    border-color: var(--matrix-green);
}

.prompt-btn:hover i,
.agent-btn:hover i {
    opacity: 1;
}

.prompt-btn:active,
.agent-btn:active {
    transform: scale(0.98);
}

/* ===== 智能体分类标题 ===== */
.agent-category {
    font-size: 0.65rem;
    color: var(--matrix-green-dark);
    margin: 12px 0 6px 0;
    padding: 0 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.agent-category i {
    margin-right: 4px;
}

/* ===== 智能体按钮 ===== */
.agent-btn {
    width: 100%;
}

.agent-btn.active-agent {
    background: var(--matrix-green-fade);
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

.agent-btn.active-agent::after {
    content: '●';
    position: absolute;
    right: 8px;
    font-size: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== 历史记录区域 ===== */
.history-section {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    min-height: 0;
}

.history-section h3 {
    margin: 0 0 10px 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--matrix-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item {
    padding: 8px 10px;
    background: var(--matrix-gray-dark);
    border: 1px solid var(--matrix-green-dim);
    font-size: 0.7rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-fast) var(--transition-easing);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-radius: 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.history-item:hover {
    background: var(--matrix-gray);
    color: var(--matrix-green);
}

.history-item.active {
    background: var(--matrix-green-fade);
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

/* ===== 主内容区域 ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.95);
    min-width: 0;
}

/* ===== 聊天头部 ===== */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 10, 0, 0.9);
    position: relative;
    min-height: 56px;
}

.chat-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--matrix-green);
    text-shadow: 0 0 8px var(--matrix-green-glow);
    flex: 1;
    text-align: center;
    letter-spacing: 1px;
}

#headerActions {
    display: flex;
    gap: 8px;
}

/* ===== 按钮组件 ===== */
.sidebar-toggle,
.stop-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    cursor: pointer;
    color: var(--matrix-green);
    border-radius: 4px;
    transition: all var(--transition-fast) var(--transition-easing);
    font-size: 0.7rem;
    min-height: 40px;
    min-width: 40px;
}

.sidebar-toggle:hover {
    background: var(--matrix-green-fade);
    box-shadow: var(--shadow-glow);
}

.stop-btn {
    background: #dc2626;
    color: white;
    border: none;
}

.stop-btn:hover {
    background: #b91c1c;
}

/* ===== 消息容器 ===== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: rgba(0, 5, 0, 0.5);
    -webkit-overflow-scrolling: touch;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.welcome-message h2 {
    margin: 0 0 16px 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--matrix-green);
    text-shadow: 0 0 16px var(--matrix-green-glow);
    letter-spacing: 2px;
}

.welcome-message p {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== 消息样式 ===== */
.message {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    background: var(--matrix-gray-dark);
    margin-bottom: 12px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-radius: 8px;
}

.message p,
.message pre {
    margin: 8px 0;
}

.message.question {
    background: var(--matrix-gray);
    border-radius: 8px 0 8px 8px;
    margin-left: 8px;
    margin-right: 8px;
}

.message.answer {
    border-radius: 0 8px 8px 8px;
    margin-left: 8px;
    margin-right: 8px;
}

/* ===== 代码块样式 ===== */
.message pre {
    width: 100%;
    padding: 14px;
    background: var(--matrix-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--matrix-green);
    box-sizing: border-box;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    position: relative;
}

/* ===== 输入区域 ===== */
.input-area {
    padding: 16px 20px;
    background: rgba(0, 10, 0, 0.95);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom, 16px);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

textarea {
    flex: 1;
    min-height: 44px;
    max-height: 150px;
    padding: 12px 16px;
    line-height: 1.5;
    resize: none;
    border: 1px solid var(--border-color);
    outline: none;
    box-sizing: border-box;
    font-size: 16px !important;
    font-family: var(--font-mono);
    background: var(--matrix-gray-dark);
    color: var(--matrix-green);
    transition: border-color var(--transition-fast) var(--transition-easing),
                box-shadow var(--transition-fast) var(--transition-easing);
}

textarea:focus {
    border-color: var(--matrix-green);
    background: var(--matrix-gray);
    box-shadow: var(--shadow-glow);
}

textarea:disabled {
    background: var(--matrix-dark);
    color: var(--text-dim);
    cursor: not-allowed;
}

textarea::placeholder {
    color: var(--text-dim);
}

.input-actions {
    display: flex;
    align-items: center;
}

#send {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    background: var(--matrix-green);
    color: var(--matrix-black);
    border: 1px solid var(--matrix-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast) var(--transition-easing);
    font-weight: 600;
    flex-shrink: 0;
    border-radius: 4px;
}

#send:active {
    transform: scale(0.95);
}

#send:hover:not(:disabled) {
    background: var(--matrix-green-light);
    box-shadow: var(--shadow-glow-strong);
}

#send:disabled {
    background: var(--matrix-dark);
    color: var(--text-dim);
    border-color: var(--matrix-green-dim);
    cursor: not-allowed;
    opacity: 0.6;
}

#send svg {
    width: 20px;
    height: 20px;
}

/* ===== 滚动条样式 ===== */
.messages-container::-webkit-scrollbar,
.history-section::-webkit-scrollbar,
.prompt-section::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.messages-container::-webkit-scrollbar-track,
.history-section::-webkit-scrollbar-track,
.prompt-section::-webkit-scrollbar-track {
    background: var(--matrix-dark);
}

.messages-container::-webkit-scrollbar-thumb,
.history-section::-webkit-scrollbar-thumb,
.prompt-section::-webkit-scrollbar-thumb {
    background: var(--matrix-green-dim);
    border-radius: 2px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.history-section::-webkit-scrollbar-thumb:hover,
.prompt-section::-webkit-scrollbar-thumb:hover {
    background: var(--matrix-green);
}

/* ===== 智能体提示 ===== */
.agent-hint {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--matrix-gray-dark);
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    padding: 8px 16px;
    font-size: 0.7rem;
    z-index: 1000;
    display: none;
    animation: slideUp var(--transition-normal) var(--transition-easing);
    border-radius: 4px;
    box-shadow: var(--shadow-glow);
    font-family: var(--font-mono);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== 动画 ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== 响应式设计 ===== */

/* 平板 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .sidebar-header .logo {
        font-size: 0.9rem;
    }
    .prompt-btn,
    .agent-btn {
        font-size: 0.65rem;
        padding: 7px 8px;
    }
    .prompt-btn i,
    .agent-btn i {
        font-size: 0.7rem;
    }
}

/* 移动端 */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 80%;
        max-width: 320px;
        z-index: 999;
        transition: left var(--transition-normal) var(--transition-easing);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        height: calc(100vh - 60px);
    }

    .chat-header {
        padding: 10px 16px;
    }

    .chat-header h2 {
        font-size: 0.95rem;
        letter-spacing: 0.5px;
    }

    .messages-container {
        padding: 16px;
    }

    .welcome-message {
        padding: 30px 16px;
    }

    .welcome-message h2 {
        font-size: 1.5rem;
    }

    .welcome-message p {
        font-size: 0.9rem;
    }

    .input-area {
        padding: 12px 16px;
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }

    .input-wrapper {
        gap: 8px;
    }

    #send {
        width: 44px;
        height: 44px;
    }

    #send svg {
        width: 18px;
        height: 18px;
    }

    .prompt-section {
        max-height: none;
    }

    /* 标签在移动端只显示图标 */
    .sidebar-tab {
        padding: 12px;
        font-size: 0;
    }

    .sidebar-tab i {
        font-size: 1rem;
        margin-bottom: 0;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .chat-header {
        padding: 8px 12px;
    }

    .chat-header h2 {
        font-size: 0.85rem;
    }

    .sidebar {
        width: 85%;
    }

    .prompt-btn,
    .agent-btn {
        padding: 8px 10px;
        font-size: 0.65rem;
    }

    .prompt-btn i,
    .agent-btn i {
        font-size: 0.7rem;
    }

    .messages-container {
        padding: 12px;
    }

    .message {
        padding: 12px 14px;
        margin-left: 4px;
        margin-right: 4px;
    }

    .input-area {
        padding: 10px 12px;
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }

    #send {
        width: 40px;
        height: 40px;
    }

    .sidebar-tab {
        padding: 10px;
    }
}

/* ===== 横屏优化 ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .messages-container {
        max-height: calc(100vh - 120px);
    }

    .welcome-message {
        padding: 20px 16px;
    }

    .welcome-message h2 {
        font-size: 1.2rem;
    }
}

/* ===== 代码块复制按钮 ===== */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--matrix-dark);
    border: 1px solid var(--matrix-green-dim);
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.code-copy-btn {
    padding: 3px 8px;
    background: var(--matrix-green-fade);
    border: 1px solid var(--border-color);
    color: var(--matrix-green);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    transition: all var(--transition-fast) var(--transition-easing);
    min-height: 32px;
}

.code-copy-btn:active {
    background: var(--matrix-green);
    color: var(--matrix-black);
}

/* ===== 加载动画 ===== */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--matrix-green);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

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

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

/* ===== 快捷命令提示 ===== */
.command-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 4px 8px;
    background: var(--matrix-dark);
    border: 1px solid var(--matrix-green-dim);
    display: inline-block;
    margin: 2px;
}

/* ===== Toast 通知 ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 10000;
}

.toast {
    padding: 10px 16px;
    background: var(--matrix-gray-dark);
    border: 1px solid var(--border-color);
    color: var(--matrix-green);
    margin-bottom: 8px;
    border-radius: 4px;
    box-shadow: var(--shadow-glow);
    animation: slideIn var(--transition-normal) var(--transition-easing);
    font-size: 0.85rem;
}

.toast.error {
    border-color: #ef4444;
    color: #ef4444;
}

.toast.success {
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

/* ===== 状态指示器 ===== */
.status-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-left: auto;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--matrix-green);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.disconnected {
    background: #ef4444;
    animation: none;
}

/* 移动端显示状态 */
@media (max-width: 768px) {
    .status-indicator {
        display: flex;
    }
}

/* ===== Token 统计 ===== */
.token-counter {
    display: none;
    font-size: 0.65rem;
    color: var(--text-dim);
    padding: 3px 6px;
    background: var(--matrix-dark);
    border: 1px solid var(--matrix-green-dim);
}

/* ===== 响应时间显示 ===== */
.response-time {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-align: right;
    margin-top: 2px;
}

/* 移动端显示 */
@media (max-width: 768px) {
    .token-counter {
        display: inline-block;
    }
}

/* ===== Markdown 样式覆盖 ===== */
.message h1,
.message h2,
.message h3,
.message h4,
.message h5,
.message h6 {
    color: var(--matrix-green);
    margin: 12px 0 6px 0;
}

.message h1 { font-size: 1.3rem; }
.message h2 { font-size: 1.15rem; }
.message h3 { font-size: 1.05rem; }

.message ul,
.message ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message li {
    margin: 4px 0;
}

.message a {
    color: var(--matrix-green);
    text-decoration: none;
    border-bottom: 1px dotted var(--matrix-green);
}

.message a:hover {
    color: var(--matrix-green-light);
    border-bottom-style: solid;
}

.message blockquote {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 2px solid var(--matrix-green);
    color: var(--text-dim);
}

.message table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.85rem;
}

.message table th,
.message table td {
    padding: 8px 10px;
    border: 1px solid var(--matrix-green-dim);
    text-align: left;
}

.message table th {
    background: var(--matrix-gray);
    color: var(--matrix-green);
}

.message table tr:hover {
    background: var(--matrix-green-fade);
}

/* ===== 工具栏（仅PC端显示） ===== */
.toolbar {
    display: flex;
    gap: 8px;
}

.toolbar-btn {
    padding: 6px 10px;
    background: var(--matrix-gray-dark);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    transition: all var(--transition-fast) var(--transition-easing);
    border-radius: 4px;
    min-height: 36px;
}

.toolbar-btn:hover {
    background: var(--matrix-gray);
    color: var(--matrix-green);
    border-color: var(--matrix-green);
}

/* 移动端隐藏工具栏 */
@media (max-width: 768px) {
    .toolbar {
        display: none;
    }
}

/* ===== 模型选择器 ===== */
.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-selector select {
    padding: 5px 10px;
    background: var(--matrix-gray-dark);
    border: 1px solid var(--border-color);
    color: var(--matrix-green);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
    border-radius: 4px;
    min-height: 36px;
}

.model-selector select:focus {
    border-color: var(--matrix-green);
    box-shadow: var(--shadow-glow);
}

/* PC端显示模型选择器 */
@media (min-width: 769px) {
    .model-selector {
        display: flex;
    }
}

/* 移动端隐藏 */
@media (max-width: 768px) {
    .model-selector {
        display: none;
    }
}
