/**
 * Gemini AI 瀵硅瘽椤甸潰鏍峰紡 - 娣辫壊涓婚
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    color: #444;
    overflow: hidden;
}

/* ===== 鍏ㄥ眬婊氬姩鏉?===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

/* ===== 涓诲鍣?===== */
.gemini-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #eef0f4;
}

/* ===== 宸︿晶瀵硅瘽鍒楄〃 ===== */
.chat-sidebar {
    width: 260px;
    min-width: 260px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 2px 0 14px rgba(15, 18, 28, 0.05);
    position: relative;
    z-index: 2;
    transition: margin-left 0.3s ease, opacity 0.3s ease;
}
.chat-sidebar.collapsed {
    margin-left: -260px;
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.new-chat-btn {
    width: 100%;
    padding: 10px 16px;
    background: rgba(52, 68, 254, 0.08);
    color: #444;
    border: 1px solid rgba(52, 68, 254, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.new-chat-btn:hover { background: rgba(52, 68, 254, 0.15); }

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: transparent;
}

/* 侧栏顶栏 / 会话列表与主区 chat-messages 同色 */
.gemini-container .sidebar-header {
    background: #f3f4f7;
    border-bottom-color: rgba(0, 0, 0, 0.06);
}
.gemini-container .conversation-list {
    background: #f3f4f7;
    border-top: none;
}

/* 算力已在站点顶栏展示，侧栏底栏省略 */
.gemini-container .sidebar-footer {
    display: none !important;
}

.conv-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.conv-item:hover { background: rgba(52, 68, 254, 0.06); color: #333; }
.conv-item.active { background: rgba(52, 68, 254, 0.1); color: #3444fe; border-left: 3px solid #3444fe; }
.conv-item .conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.conv-item .conv-delete {
    opacity: 0; color: #888; cursor: pointer; font-size: 14px; padding: 2px 6px;
    transition: opacity 0.2s;
}
.conv-item:hover .conv-delete { opacity: 1; }
.conv-item .conv-delete:hover { color: #ff6b6b; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.power-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
}
.power-icon { font-size: 16px; }
.power-value { color: #ffd700; font-weight: 600; }

/* ===== 涓昏亰澶╁尯 ===== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: #f3f4f7;
}

/* 椤堕儴鏍?*/
.chat-topbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: #ffffff;
    gap: 12px;
    min-height: 48px;
}
.sidebar-toggle-btn, .settings-toggle-btn, .artifacts-toggle-btn {
    background: none; border: none; color: #888; cursor: pointer;
    font-size: 18px; padding: 6px 8px; border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    position: relative;
}
.sidebar-toggle-btn:hover, .settings-toggle-btn:hover, .artifacts-toggle-btn:hover {
    background: rgba(52, 68, 254, 0.08); color: #3444fe;
}
.artifacts-toggle-btn.is-active { color: #3444fe; background: rgba(52, 68, 254, 0.08); }
.artifacts-toggle-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #3444fe;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
}
.chat-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}
.settings-toggle-btn { margin-left: 0; }

/* ===== 娑堟伅鍖哄煙 ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    background: #f3f4f7;
}

/* 娆㈣繋灞忓箷 */
/* 欢迎屏幕 */
.welcome-screen {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; flex: 1; padding: 40px 20px; text-align: center;
    position: relative; width: 100%; max-width: 560px; margin: 0 auto;
}
.welcome-artifacts-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 999px;
    background: #fff;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.welcome-artifacts-btn:hover,
.welcome-artifacts-btn.is-active {
    border-color: rgba(52, 68, 254, 0.25);
    color: #3444fe;
    box-shadow: 0 2px 8px rgba(52, 68, 254, 0.08);
}
.welcome-artifacts-badge,
.artifacts-fab-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #3444fe;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
}
.welcome-icon { font-size: 48px; margin-bottom: 16px; }
.welcome-screen h2, .welcome-screen .welcome-model-name { font-size: 24px; font-weight: 600; margin-bottom: 8px; color: #333; }
.welcome-screen p, .welcome-screen .welcome-model-desc { font-size: 14px; color: #888; margin-bottom: 30px; max-width: 420px; line-height: 1.6; }
.welcome-suggestions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 500px; width: 100%;
}
.suggestion-card {
    padding: 14px 16px; background: #ffffff; border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px; cursor: pointer; font-size: 13px; color: #666;
    text-align: left; transition: background 0.2s, border-color 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.suggestion-card:hover { background: rgba(52, 68, 254, 0.04); border-color: rgba(52, 68, 254, 0.2); color: #333; }

/* 娑堟伅姘旀场 */
.message { padding: 16px 20px; max-width: 800px; width: 100%; margin: 0 auto; }
.message.user .message-content {
    background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); padding: 12px 16px; border-radius: 16px 16px 4px 16px;
    display: inline-block; max-width: 80%; float: right; clear: both;
    font-size: 14px; line-height: 1.6; color: #fff;
}
.message.user .message-images {
    float: right; clear: both; margin-bottom: 8px; max-width: 80%;
}
.message.user .message-images img {
    max-width: 200px; max-height: 200px; border-radius: 12px; object-fit: cover;
}
.message.assistant { padding: 16px 20px; }
.message.assistant .message-content {
    font-size: 14px; line-height: 1.7; clear: both;
}

/* 鎬濈淮閾?*/
.thinking-block {
    margin-bottom: 12px; border-left: 3px solid #3444fe; padding-left: 12px;
}
.thinking-toggle {
    cursor: pointer; font-size: 13px; color: #888; display: flex;
    align-items: center; gap: 6px; margin-bottom: 6px; user-select: none;
}
.thinking-toggle:hover { color: #aaa; }
.thinking-toggle .arrow { transition: transform 0.2s; display: inline-block; font-size: 10px; }
.thinking-toggle .arrow.open { transform: rotate(90deg); }
.thinking-content {
    font-size: 13px; color: #888; line-height: 1.6; font-style: italic;
    max-height: 400px; overflow-y: auto; transition: max-height 0.3s;
    white-space: pre-wrap; word-break: break-word;
}
.thinking-content.collapsed { max-height: 0; overflow: hidden; padding: 0; }

/* 鎵撳瓧鎸囩ず鍣?*/
.typing-indicator { display: inline-flex; align-items: center; gap: 5px; padding: 8px 0; }
.typing-indicator .typing-label {
    font-size: 13px; color: #888; margin-right: 2px;
    width: auto; height: auto; background: none; border-radius: 0; animation: none;
}
.typing-indicator .typing-timer {
    font-size: 13px; color: #3444fe; margin-right: 4px; font-variant-numeric: tabular-nums;
    width: auto; height: auto; background: none; border-radius: 0; animation: none;
}
.typing-indicator span:not(.typing-label):not(.typing-timer) {
    width: 6px; height: 6px; background: #888; border-radius: 50%;
    animation: blink 1.4s infinite both;
}
.typing-indicator span:nth-child(4) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(5) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0.3} 40%{opacity:1} }

/* Markdown鍐呭鏍峰紡 */
.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul, .message-content ol { padding-left: 20px; margin-bottom: 8px; }
.message-content li { margin-bottom: 4px; }
.message-content strong { color: #333; }
.message-content a { color: #3444fe; text-decoration: none; }
.message-content a:hover { text-decoration: underline; }
.message-content blockquote {
    border-left: 3px solid #ddd; padding-left: 12px; margin: 8px 0; color: #888;
}

/* 浠ｇ爜鍧?*/
.message-content code {
    background: rgba(52, 68, 254, 0.06); padding: 2px 6px; border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; color: #d63384;
}
.message-content pre {
    background: #f8f9fa; border-radius: 8px; margin: 8px 0; overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}
.message-content pre code {
    display: block; padding: 14px 16px; overflow-x: auto; background: transparent;
    color: #333; white-space: pre;
}
.code-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 12px; background: rgba(52, 68, 254, 0.05); font-size: 12px; color: #888;
}
.copy-code-btn {
    background: none; border: none; color: #888; cursor: pointer;
    font-size: 12px; padding: 2px 8px; border-radius: 4px;
}
.copy-code-btn:hover { background: rgba(52, 68, 254, 0.08); color: #333; }


/* ===== 杈撳叆鍖哄煙 ===== */
.chat-input-area {
    padding: 12px 20px 16px; max-width: 800px; width: 100%; margin: 0 auto;
}
.gemini-container .chat-input-area {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* DeepSeek / Gemini：输入框透明文字 + 外圈描边 */
.gemini-container .input-wrapper.input-wrapper-unified {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.gemini-container .input-wrapper-unified:focus-within {
    border-color: #3444fe;
    box-shadow: 0 0 0 2px rgba(52, 68, 254, 0.1);
}
.gemini-container .input-wrapper-unified #chatInput,
.gemini-container #chatInput {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.gemini-container .input-wrapper-unified.is-drag-over {
    background: rgba(52, 68, 254, 0.04);
    border-color: #3444fe;
    box-shadow: 0 0 0 2px rgba(52, 68, 254, 0.15);
}
.image-preview-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #ffffff; border-radius: 10px 10px 0 0;
    border: 1px solid rgba(0,0,0,0.08); border-bottom: none;
}
.preview-thumb img {
    width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
}
.remove-image-btn {
    background: rgba(0,0,0,0.06); border: none; color: #888; cursor: pointer;
    width: 24px; height: 24px; border-radius: 50%; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.remove-image-btn:hover { background: rgba(255,100,100,0.3); color: #ff6b6b; }

.input-wrapper {
    display: flex; align-items: flex-end; gap: 8px;
    background: #ffffff; border: 1px solid rgba(0,0,0,0.1); border-radius: 12px;
    padding: 8px 12px; transition: border-color 0.2s;
}
.input-wrapper-unified {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 12px 8px;
}
.input-wrapper-unified:focus-within { border-color: #3444fe; }
.input-wrapper-unified #chatInput {
    display: block;
    width: 100%;
    flex: 0 0 auto;
    order: 1;
    margin-bottom: 8px;
    min-height: 28px;
    border: none;
    background: transparent;
    resize: none;
}
.input-wrapper-unified .chat-input-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    order: 2;
    flex: 0 0 auto;
    width: 100%;
    padding-top: 4px;
    border-top: none;
}
.input-wrapper-unified .chat-input-bar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.input-wrapper-unified .chat-input-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.input-wrapper-unified .chat-input-model-wrap,
.input-wrapper-unified .chat-input-mode-wrap {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 140px;
}
.input-wrapper-unified .chat-model-pill--minimal {
    border: none;
    background: transparent;
    box-shadow: none;
    min-height: 28px;
    height: 28px;
    padding: 0 6px;
    gap: 4px;
}
.input-wrapper-unified .chat-model-pill--minimal:hover {
    background: rgba(0, 0, 0, 0.04);
}
.input-wrapper-unified .chat-model-pill--minimal[aria-expanded="true"] {
    border: none;
    box-shadow: none;
    background: rgba(52, 68, 254, 0.06);
}
.input-wrapper-unified .chat-model-pill--minimal .editor-model-pill-ico,
.input-wrapper-unified .chat-model-pill--minimal .editor-model-pill-desc {
    display: none;
}
.input-wrapper-unified .chat-model-pill--minimal .editor-model-pill-body {
    flex-direction: row;
    align-items: center;
    min-width: 0;
}
.input-wrapper-unified .chat-model-pill--minimal .editor-model-pill-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}
.input-wrapper-unified .chat-model-pill--minimal .editor-model-pill-caret {
    font-size: 10px;
    flex-shrink: 0;
}
.input-wrapper-unified .kzt-aux-btn {
    padding: 4px 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    background: transparent;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.input-wrapper-unified .kzt-aux-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #333;
}
.input-wrapper-unified .kzt-aux-btn:disabled,
.input-wrapper-unified .kzt-aux-btn.is-loading {
    opacity: 0.55;
    cursor: progress;
}
.input-wrapper-unified .kzt-attach-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #fff;
    color: #444;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.input-wrapper-unified .kzt-attach-btn:hover:not(.is-locked):not(:disabled) {
    border-color: #3444fe;
    color: #3444fe;
    box-shadow: 0 0 0 2px rgba(52, 68, 254, 0.12);
}
.input-wrapper-unified .kzt-attach-btn.is-active {
    border-color: #3444fe;
    color: #3444fe;
    background: rgba(52, 68, 254, 0.06);
}
.input-wrapper-unified .kzt-attach-btn.is-locked,
.input-wrapper-unified .kzt-attach-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    filter: grayscale(0.6);
    box-shadow: none;
}
.kzt-attach-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px 0;
}
.kzt-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(52, 68, 254, 0.08);
    border: 1px solid rgba(52, 68, 254, 0.15);
    font-size: 12px;
    color: #333;
}
.kzt-attach-chip img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}
.kzt-attach-chip-remove {
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
}
.kzt-attach-chip-remove:hover { color: #e74c3c; }
.kzt-msg-image { margin-bottom: 8px; }
.kzt-msg-image img { max-width: 240px; max-height: 180px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.08); object-fit: contain; }
.input-wrapper-unified.is-drag-over {
    border-color: #3444fe !important;
    box-shadow: 0 0 0 2px rgba(52, 68, 254, 0.15);
    background: rgba(52, 68, 254, 0.03);
}
.kzt-save-folder-wrap { margin-top: 10px; }
.kzt-save-folder-btn {
    border: 1px solid rgba(52, 68, 254, 0.25);
    background: rgba(52, 68, 254, 0.06);
    color: #3444fe;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.kzt-save-folder-btn:hover:not(:disabled) { background: rgba(52, 68, 254, 0.12); }
.kzt-save-folder-btn:disabled { opacity: 0.6; cursor: wait; }
.input-wrapper-unified .send-btn {
    flex-shrink: 0;
    margin-left: 0;
}
.input-wrapper:focus-within { border-color: #3444fe; }

.attach-btn {
    background: none; border: none; color: #888; cursor: pointer;
    font-size: 20px; padding: 4px; flex-shrink: 0;
    transition: color 0.2s;
}
.attach-btn:hover { color: #333; }

#chatInput {
    flex: 1; background: transparent; border: none; color: #333;
    font-size: 14px; line-height: 1.5; resize: none; outline: none;
    max-height: 150px; min-height: 24px; font-family: inherit;
}
#chatInput::placeholder { color: #aaa; }

.send-btn {
    background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); border: none; color: #fff; cursor: pointer;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 13px; transition: opacity 0.2s;
}
.send-btn.kzt-send-btn {
    height: 36px;
    padding: 0 12px 0 10px;
    border-radius: 999px;
    min-width: 72px;
}
.send-btn:not(.kzt-send-btn) {
    width: 36px; height: 36px; border-radius: 50%;
}
.send-btn:hover { opacity: 0.85; }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn .send-icon { line-height: 1; flex-shrink: 0; }
.send-btn .send-power {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}

.input-hint {
    text-align: center; font-size: 11px; color: #555; margin-top: 0;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 0 4px;
    flex-wrap: wrap;
}

.chat-input-model-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-model-label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.chat-input-model-select {
    min-width: 160px;
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: #f8f9fc;
    color: #333;
    cursor: pointer;
}

.chat-input-model-select:focus {
    outline: none;
    border-color: #3444fe;
}

.chat-input-footer .input-hint {
    margin-left: auto;
    text-align: right;
}

@media (max-width: 640px) {
    .chat-input-footer .input-hint { width: 100%; text-align: center; margin-left: 0; }
}

/* ===== 璁剧疆闈㈡澘 ===== */
.settings-panel {
    width: 280px; min-width: 280px; background: #ffffff;
    border-left: 1px solid rgba(0,0,0,0.06); display: flex; flex-direction: column;
    overflow-y: auto;
}
.settings-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.settings-header h3 { font-size: 15px; font-weight: 500; }
.close-settings-btn {
    background: none; border: none; color: #888; cursor: pointer;
    font-size: 18px; padding: 4px 8px; border-radius: 6px;
}
.close-settings-btn:hover { background: rgba(52, 68, 254, 0.08); color: #3444fe; }

.settings-body { padding: 16px; }
.setting-group { margin-bottom: 24px; }
.setting-group label { font-size: 14px; font-weight: 500; display: block; margin-bottom: 4px; }
.setting-desc { font-size: 12px; color: #888; margin-bottom: 10px; }

.range-wrapper { display: flex; align-items: center; gap: 10px; }
.range-wrapper input[type="range"] {
    flex: 1; -webkit-appearance: none; height: 4px; background: rgba(0,0,0,0.1);
    border-radius: 2px; outline: none;
}
.range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px; background: #3444fe;
    border-radius: 50%; cursor: pointer;
}
.range-value {
    min-width: 50px; text-align: right; font-size: 13px; color: #aaa; font-variant-numeric: tabular-nums;
}
.range-labels {
    display: flex; justify-content: space-between; font-size: 11px; color: #666; margin-top: 4px;
}

/* ===== 对话产物弹窗（左右分栏） ===== */
.kzt-artifacts-modal {
    position: fixed;
    inset: 0;
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.kzt-artifacts-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}
.kzt-artifacts-modal-box {
    position: relative;
    width: min(960px, 96vw);
    height: min(640px, 88vh);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.kzt-artifacts-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.kzt-artifacts-modal-title { font-size: 15px; font-weight: 600; color: #333; }
.kzt-artifacts-modal-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.kzt-artifacts-modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
}
.kzt-artifacts-left {
    width: 38%;
    min-width: 260px;
    border-right: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.kzt-artifacts-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fafafa;
}
.kzt-artifacts-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    flex-shrink: 0;
}
.kzt-artifacts-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kzt-artifacts-preview-body {
    flex: 1;
    overflow: auto;
    padding: 14px;
    min-height: 0;
}
.artifacts-preview-empty {
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 13px;
}
.close-artifacts-btn {
    background: none; border: none; color: #aaa; cursor: pointer;
    font-size: 16px; padding: 4px 6px; border-radius: 6px; line-height: 1;
}
.close-artifacts-btn:hover { color: #333; background: rgba(0,0,0,0.04); }
.artifacts-sel-info { font-size: 11px; color: #999; white-space: nowrap; }
.artifacts-tool-btn {
    border: 1px solid rgba(52, 68, 254, 0.25);
    background: rgba(52, 68, 254, 0.06);
    color: #3444fe;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.artifacts-tool-btn:hover:not(:disabled) { background: rgba(52, 68, 254, 0.12); }
.artifacts-tool-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.artifacts-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.artifacts-filter-btn {
    border: none;
    background: transparent;
    color: #999;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
}
.artifacts-filter-btn:hover { color: #666; background: rgba(0,0,0,0.04); }
.artifacts-filter-btn.is-active { color: #3444fe; background: rgba(52, 68, 254, 0.08); }
.artifacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
}
.artifacts-empty {
    text-align: center;
    color: #bbb;
    font-size: 12px;
    padding: 32px 12px;
    line-height: 1.6;
}
.artifact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}
.artifact-row:hover { background: rgba(0,0,0,0.03); }
.artifact-row.is-active { background: rgba(52, 68, 254, 0.08); }
.artifact-row.is-selected { background: rgba(52, 68, 254, 0.04); }
.artifact-row-check {
    width: 15px;
    height: 15px;
    accent-color: #3444fe;
    flex-shrink: 0;
    cursor: pointer;
}
.artifact-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    overflow: hidden;
}
.artifact-row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.artifact-row-body { flex: 1; min-width: 0; }
.artifact-row-title {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.artifact-row-meta {
    font-size: 10px;
    color: #aaa;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.artifact-row-preview {
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}
.artifact-row-preview:hover { color: #3444fe; background: rgba(52, 68, 254, 0.06); }

.artifact-row-preview { display: none; }

/* 右侧预览区内容样式 */
.kzt-artifacts-preview-body pre {
    margin: 0;
    padding: 12px;
    background: #1e1e1e;
    color: #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
    max-height: 100%;
}
.kzt-artifacts-preview-body img,
.kzt-artifacts-preview-body video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}
.kzt-artifacts-preview-body iframe {
    width: 100%;
    min-height: 360px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    background: #fff;
}
.kzt-artifacts-preview-body .kzt-artifact-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
}
.kzt-artifacts-preview-body .kzt-artifact-preview-table th,
.kzt-artifacts-preview-body .kzt-artifact-preview-table td {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 6px 8px;
    text-align: left;
}
.kzt-artifacts-preview-body .kzt-artifact-preview-table th { background: #f5f5f5; }
.kzt-artifacts-preview-body .kzt-artifact-preview-fallback {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.kzt-artifact-dl-btn {
    border: 1px solid rgba(52, 68, 254, 0.3);
    background: rgba(52, 68, 254, 0.06);
    color: #3444fe;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.kzt-artifact-dl-btn:hover:not(:disabled) { background: rgba(52, 68, 254, 0.12); }
.kzt-artifact-dl-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ===== 产物预览弹窗（旧，保留兼容） ===== */
.kzt-artifact-preview {
    position: fixed;
    inset: 0;
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.kzt-artifact-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}
.kzt-artifact-preview-box {
    position: relative;
    width: min(920px, 96vw);
    max-height: 88vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.kzt-artifact-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.kzt-artifact-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}
.kzt-artifact-preview-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.kzt-artifact-dl-btn {
    border: 1px solid rgba(52, 68, 254, 0.3);
    background: rgba(52, 68, 254, 0.06);
    color: #3444fe;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.kzt-artifact-dl-btn:hover { background: rgba(52, 68, 254, 0.12); }
.kzt-artifact-preview-close {
    border: none;
    background: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.kzt-artifact-preview-close:hover { background: rgba(0,0,0,0.05); color: #333; }
.kzt-artifact-preview-body {
    flex: 1;
    overflow: auto;
    padding: 16px;
    min-height: 200px;
}
.kzt-artifact-preview-body pre {
    margin: 0;
    padding: 12px;
    background: #1e1e1e;
    color: #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
    max-height: 70vh;
}
.kzt-artifact-preview-body img,
.kzt-artifact-preview-body video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}
.kzt-artifact-preview-body iframe {
    width: 100%;
    min-height: 60vh;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    background: #fff;
}
.kzt-artifact-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.kzt-artifact-preview-table th,
.kzt-artifact-preview-table td {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 6px 8px;
    text-align: left;
}
.kzt-artifact-preview-table th { background: #f5f5f5; }
.kzt-artifact-preview-fallback {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .chat-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; }
    .chat-sidebar.collapsed { margin-left: -260px; }
    .settings-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 100; }
    .kzt-artifacts-modal-body { flex-direction: column; }
    .kzt-artifacts-left { width: 100%; min-width: 0; max-height: 42%; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.06); }
    .welcome-suggestions { grid-template-columns: 1fr; }
    .message.user .message-content { max-width: 90%; }
}

/* ===== 鍋滄鎸夐挳 ===== */
.stop-btn {
    background: #ff4444; border: none; color: #fff; cursor: pointer;
    padding: 8px 20px; border-radius: 20px; font-size: 13px;
    margin: 0 auto; display: none; transition: background 0.2s;
}
.stop-btn:hover { background: #ff5555; }
.stop-btn.visible { display: block; }
