/* 现代化简洁风格 - 类似Gemini设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #ffffff;
    color: #202124;
    min-height: 100vh;
    line-height: 1.6;
    overflow: hidden;
}

/* 主布局 */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 左侧边栏 */
.sidebar {
    width: 240px;
    background: #e8f0fe;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #dadce0;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border-bottom: 1px solid #dadce0;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
}

.sidebar-content {
    flex: 1;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    color: #202124;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.new-chat-btn:hover {
    background: #f1f3f4;
}

.new-chat-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.new-chat-btn span {
    white-space: nowrap;
}

.sidebar-btn {
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    color: #202124;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-btn:hover {
    background: #f1f3f4;
}

.sidebar-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-btn span {
    white-space: nowrap;
}


/* 历史对话区域 */
.chat-history-section {
    flex: 1;
    overflow-y: auto;
    margin-top: 16px;
    min-height: 0;
}

.history-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    background: #f1f3f4;
}

.history-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.history-item-title {
    font-size: 14px;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.history-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #5f6368;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    flex-shrink: 0;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: rgba(234, 67, 53, 0.1);
    color: #ea4335;
}

.history-item-delete svg {
    width: 16px;
    height: 16px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
    position: relative;
}

/* AI Ops按钮 - 右上角 */
.ai-ops-top-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ff9800;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.ai-ops-top-btn:hover {
    background: #fb8c00;
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.4);
    transform: translateY(-1px);
}

.ai-ops-top-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-container.centered {
    justify-content: center;
    align-items: center;
    min-height: 100%;
}

.chat-messages {
    flex: 1;
    padding: 64px 24px 24px 24px;
    overflow-y: auto;
    background: #ffffff;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.5s ease;
    max-width: 100%;
}

@media (min-width: 768px) {
    .chat-messages {
        padding: 72px 24px 32px 24px;
    }
}

.chat-container.centered .chat-messages {
    flex: 0 1 auto;
    justify-content: center;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    min-height: auto;
}

.chat-container.centered .chat-input-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    flex-shrink: 0;
}

.chat-container:not(.centered) .chat-messages {
    justify-content: flex-start;
    align-items: stretch;
}

.welcome-greeting {
    text-align: center;
    color: #1a73e8;
    font-size: 1.5rem;
    padding: 20px;
    font-weight: 400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.chat-container.centered .welcome-greeting {
    opacity: 1;
    visibility: visible;
    order: -1;
}

.chat-container:not(.centered) .welcome-greeting {
    opacity: 0;
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
}

.welcome-greeting p {
    margin: 0;
}

.welcome-message {
    text-align: center;
    color: #1a73e8;
    font-size: 1.5rem;
    padding: 60px 20px;
    font-weight: 400;
}

/* 消息样式 */
.message {
    margin-bottom: 24px;
    display: flex;
    width: 100%;
}

.message.user {
    flex-direction: column;
    align-items: flex-end;
}

/* AI消息容器 - 包含图标和内容 */
.message.assistant {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
}

/* AI消息图标 - 蓝色四角星 */
.message-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message.assistant .message-avatar svg {
    width: 20px;
    height: 20px;
}

/* 消息内容容器 */
.message-content-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* AI消息的包装器需要减去头像宽度 */
.message.assistant .message-content-wrapper {
    flex: 1;
    max-width: calc(100% - 44px);
}

/* 用户消息的包装器不需要限制宽度，让它根据内容自适应 */
.message.user .message-content-wrapper {
    max-width: 70%;
    align-items: flex-end;
    flex: 0 1 auto;
    width: auto;
}

.message-content {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 400;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    display: block;
    max-width: 100%;
    box-sizing: border-box;
}

.message.user .message-content {
    background: #e8eaed;
    color: #202124;
    border-bottom-right-radius: 4px;
    font-weight: 400;
    width: 100%;
}

.message.assistant .message-content {
    background: #ffffff;
    color: #202124;
    border: none;
    border-bottom-left-radius: 4px;
    box-shadow: none;
}

/* Markdown渲染样式 */
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.25;
}

.message-content h1 { font-size: 1.5em; border-bottom: 1px solid #e8eaed; padding-bottom: 8px; }
.message-content h2 { font-size: 1.3em; border-bottom: 1px solid #e8eaed; padding-bottom: 6px; }
.message-content h3 { font-size: 1.15em; }
.message-content h4 { font-size: 1em; }

.message-content p {
    margin-top: 0;
    margin-bottom: 10px;
}

.message-content ul, .message-content ol {
    margin-top: 0;
    margin-bottom: 10px;
    padding-left: 24px;
}

.message-content li {
    margin-bottom: 4px;
}

.message-content code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
    color: #202124;
}

.message-content pre {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid #e8eaed;
}

.message-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
    line-height: 1.5;
}

.message-content blockquote {
    border-left: 4px solid #e8eaed;
    padding-left: 16px;
    margin: 10px 0;
    color: #5f6368;
    font-style: italic;
}

.message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.message-content th, .message-content td {
    border: 1px solid #e8eaed;
    padding: 8px 12px;
    text-align: left;
}

.message-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.message-content a {
    color: #1a73e8;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.message-content hr {
    border: none;
    border-top: 1px solid #e8eaed;
    margin: 16px 0;
}

.message-time {
    font-size: 0.75rem;
    color: #9aa0a6;
    margin-top: 4px;
    padding: 0 4px;
    font-weight: 400;
}

.message.user .message-time {
    text-align: right;
    padding-right: 4px;
}

.message.assistant .message-time {
    text-align: left;
    padding-left: 4px;
}

/* 流式消息动画 */
.streaming {
    position: relative;
}

.streaming::after {
    content: '▋';
    animation: blink 1.2s infinite;
    color: #1a73e8;
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 加载消息样式 */
.loading-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-spinner-icon {
    display: inline-flex;
    align-items: center;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 输入区域 */
.chat-input-container {
    padding: 20px;
    background: #ffffff;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

.input-group-wrapper {
    max-width: 800px;
    width: 100%;
}

.tools-btn-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tools-btn, .file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;
    transition: color 0.2s, background 0.2s;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.tools-btn:hover, .file-btn:hover {
    color: #202124;
    background: #f1f3f4;
}

.tools-icon, .file-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
    flex-shrink: 0;
}

.tools-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(60, 64, 67, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
    z-index: 1000;
    padding: 8px;
}

.tools-btn-wrapper.active .tools-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tools-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    color: #202124;
    font-size: 14px;
}

.tools-menu-item:hover {
    background: #f1f3f4;
}

.tools-menu-item svg {
    width: 20px;
    height: 20px;
    color: #5f6368;
    flex-shrink: 0;
}

.tools-menu-item span {
    white-space: nowrap;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid #dadce0;
    border-radius: 24px;
    background: #ffffff;
    transition: all 0.2s;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.input-wrapper:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.input-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
}

.right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    color: #202124;
    background: transparent;
    font-weight: 400;
    padding: 0;
    min-height: 24px;
}

.message-input::placeholder {
    color: #9aa0a6;
}

.mode-selector-wrapper {
    position: relative;
}

.mode-selector-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
    transition: color 0.2s;
    white-space: nowrap;
}

.mode-selector-btn:hover {
    color: #202124;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.mode-selector-wrapper.active .dropdown-arrow {
    transform: rotate(180deg);
}

.mode-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(60, 64, 67, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
    z-index: 1000;
}

.mode-selector-wrapper.active .mode-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    border-bottom: 1px solid #dadce0;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f1f3f4;
}

.dropdown-item.active {
    background: rgba(26, 115, 232, 0.1);
}

.dropdown-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 4px;
}

.dropdown-item-sub {
    font-size: 12px;
    color: #5f6368;
}

.badge-new {
    background: #1a73e8;
    color: #ffffff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.send-btn-circle {
    width: 36px;
    height: 36px;
    background: #f1f3f4;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn-circle:hover {
    background: #e8eaed;
    color: #202124;
}

.send-btn-circle:disabled {
    background: #f1f3f4;
    color: #dadce0;
    cursor: not-allowed;
}

.send-btn-circle svg {
    width: 20px;
    height: 20px;
}

/* 自定义滚动条 */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 300px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 文件上传相关 */
.upload-status {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
    text-align: center;
}

.upload-status.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    display: block;
}

.upload-status.error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
    display: block;
}

.upload-status.uploading {
    background: rgba(25, 118, 210, 0.15);
    color: #1976d2;
    border: 1px solid rgba(25, 118, 210, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(25, 118, 210, 0.3);
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 智能运维消息样式 */
.aiops-message {
    max-width: 90%;
}

.aiops-message .message-content {
    max-width: 100%;
    background: rgba(26, 115, 232, 0.05);
    border: 1px solid rgba(26, 115, 232, 0.2);
}

/* 详情折叠区域 */
.aiops-details {
    margin-bottom: 16px;
    width: 100%;
}

.details-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(26, 115, 232, 0.05);
    border: 1px solid rgba(26, 115, 232, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #1a73e8;
    font-weight: 500;
}

.details-toggle:hover {
    background: rgba(26, 115, 232, 0.1);
    border-color: rgba(26, 115, 232, 0.3);
}

.details-toggle.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.details-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(26, 115, 232, 0.2);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.details-content.expanded {
    max-height: 2000px;
    padding: 16px;
}

.detail-item {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(26, 115, 232, 0.03);
    border-left: 3px solid #1a73e8;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #202124;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item strong {
    color: #1a73e8;
    font-weight: 600;
}

/* 加载遮罩层样式 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(26, 115, 232, 0.2);
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 0.9rem;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .message-content {
        max-width: 90%;
        font-size: 0.9rem;
    }
    
    .input-wrapper {
        flex-wrap: wrap;
    }
    
    .mode-selector-wrapper {
        order: -1;
        width: 100%;
        margin-left: 0;
        margin-bottom: 8px;
    }
    
    .mode-selector-btn {
        width: 100%;
        justify-content: space-between;
    }
    
    .mode-dropdown {
        width: 100%;
        right: 0;
    }
}

/* 知识库文件列表样式 */
.knowledge-base-section {
    margin-top: 20px;
    border-top: 1px solid #dadce0;
    padding-top: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: #5f6368;
    font-size: 0.85rem;
    font-weight: 600;
}

.section-header svg {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

.section-header span {
    flex: 1;
}

.refresh-btn {
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background-color: #f1f3f4;
    color: #202124;
}

.refresh-btn svg {
    width: 16px;
    height: 16px;
    margin-right: 0;
}

.refresh-btn:active {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.knowledge-base-list {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #dadce0 transparent;
}

.knowledge-base-list::-webkit-scrollbar {
    width: 6px;
}

.knowledge-base-list::-webkit-scrollbar-track {
    background: transparent;
}

.knowledge-base-list::-webkit-scrollbar-thumb {
    background-color: #dadce0;
    border-radius: 3px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: #5f6368;
    font-size: 0.85rem;
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.file-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    margin-bottom: 4px;
}

.file-item:hover {
    background-color: #f1f3f4;
}

.file-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #10a37f;
    background-color: rgba(16, 163, 127, 0.1);
    border-radius: 6px;
}

.file-icon svg {
    width: 18px;
    height: 18px;
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 0.85rem;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.file-size {
    font-size: 0.75rem;
    color: #5f6368;
}

.file-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #ea4335;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
    opacity: 0;
}

.file-item:hover .file-delete-btn {
    opacity: 1;
}

.file-delete-btn:hover {
    background-color: rgba(234, 67, 53, 0.1);
    transform: scale(1.05);
}

.file-delete-btn:active {
    transform: scale(0.95);
}

.file-delete-btn svg {
    width: 16px;
    height: 16px;
}

[data-theme="dark"] .file-delete-btn {
    color: #ff6b6b;
}

[data-theme="dark"] .file-delete-btn:hover {
    background-color: rgba(255, 107, 107, 0.15);
}

[data-theme="dark"] .file-icon {
    background-color: rgba(16, 163, 127, 0.2);
}

[data-theme="light"] .file-icon {
    background-color: rgba(0, 82, 217, 0.1);
}

[data-theme="light"] .file-icon {
    color: #0052D9;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .knowledge-base-section {
        margin-top: 16px;
        padding-top: 12px;
    }
    
    .knowledge-base-list {
        max-height: 200px;
    }
    
    .file-item {
        padding: 8px 10px;
    }
    
    .file-icon {
        width: 28px;
        height: 28px;
    }
    
    .file-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .file-name {
        font-size: 0.8rem;
    }

    .file-size {
        font-size: 0.7rem;
    }
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #dadce0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #202124;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #5f6368;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f1f3f4;
    color: #202124;
}

.modal-body {
    padding: 24px;
}

.aiops-input-group {
    margin-bottom: 16px;
}

.aiops-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #202124;
}

.aiops-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    background-color: #ffffff;
    color: #202124;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.aiops-textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.aiops-textarea::placeholder {
    color: #9aa0a6;
}

.aiops-tips {
    background-color: rgba(26, 115, 232, 0.08);
    border-radius: 8px;
    padding: 12px 16px;
}

.aiops-tips p {
    margin: 0;
    font-size: 0.8rem;
    color: #1a73e8;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #dadce0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background-color: #f1f3f4;
    color: #202124;
    border: 1px solid #dadce0;
}

.btn-secondary:hover {
    background-color: #e8eaed;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background-color: #0d65d9;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

