/* --- Global Styles & Variables --- */
:root {
    --light-bg-primary: #e6f2ff; /* 更淡蓝色背景 */
    --light-bg-secondary: #c7e2ff; /* 稍深的淡蓝色背景 */
    --accent-blue-primary: #2c7bdc; /* 更深蓝的主色调 - 匹配湖水 */
    --accent-blue-secondary: #4a94f1; /* 蓝色强调色 - 匹配天空 */
    --accent-blue-tertiary: #0a4da3; /* 更深的蓝色 - 匹配山脉轮廓 */
    --text-primary: #333333; /* 深灰文本 */
    --text-secondary: #5f6368; /* 中灰文本 */
    --border-color: rgba(44, 123, 220, 0.25); /* 淡蓝色边框 */
    --glow-color: rgba(74, 148, 241, 0.35); /* 微蓝色阴影 */
    --shadow-color: rgba(10, 77, 163, 0.15); /* 淡阴影 */
    --wood-color: #dda15e; /* 木栈道颜色 - 温暖对比色 */
    --wood-color-dark: #bc6c25; /* 更深的木栈道颜色 */
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--light-bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 更改为蓝色湖泊背景图片 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?q=80&w=2070');
    background-size: cover;
    background-position: center;
    opacity: 0.2; /* 增加一点透明度使其更加明显 */
    z-index: -1;
    animation: subtleZoom 60s infinite alternate ease-in-out;
}

/* 添加背景微缩放动画效果 */
@keyframes subtleZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

/* 优化水波纹动画容器样式 - 添加更多细节 */
.water-ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.7; /* 降低整体透明度使效果更微妙 */
}

/* 改进水波纹样式 */
.water-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(193, 233, 252, 0.7) 20%,
        rgba(104, 175, 241, 0.5) 40%,
        rgba(44, 123, 220, 0.3) 60%,
        rgba(255, 255, 255, 0) 75%
    );
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity, width, height, left, top;
    filter: blur(2px); /* 添加轻微模糊效果增强水波感 */
}

.water-ripple.active {
    animation: rippleEffect 4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* 改进水波纹动画效果，更加平滑自然 */
@keyframes rippleEffect {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.9;
    }
    40% {
        opacity: 0.5;
    }
    75% {
        opacity: 0.2;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* 添加点击效果水波纹 */
.ripple-effect {
    position: absolute;
    background: radial-gradient(
        circle, 
        rgba(193, 233, 252, 0.8) 0%, 
        rgba(104, 175, 241, 0.6) 40%, 
        rgba(44, 123, 220, 0.1) 80%, 
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    animation: ripple 0.8s ease-out;
    z-index: 0;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* 为可点击元素添加水波纹触发效果 */
.nav-item, button, .agent-card, .prompt-card, .use-prompt-btn, .copy-prompt-btn {
    position: relative;
    overflow: hidden; /* 确保波纹效果被容器裁切 */
}

/* 屏幕阅读器专用样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Scrollbar Styles --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--light-bg-secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background-color: var(--accent-blue-primary);
    border-radius: 4px;
    border: 2px solid var(--light-bg-secondary);
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-blue-secondary);
}

/* --- App Container --- */
.app-container {
    display: flex;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.7); /* 调整为更透明 */
    backdrop-filter: blur(5px); /* 添加模糊效果使背景更清晰 */
}

/* 添加水波纹背景动画 */
.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(193, 233, 252, 0.2) 0%,
        rgba(104, 175, 241, 0.05) 60%,
        rgba(74, 148, 241, 0.1) 100%
    );
    z-index: -2;
    pointer-events: none;
}

.app-container::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(193, 233, 252, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 50%, rgba(104, 175, 241, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 30% 70%, rgba(74, 148, 241, 0.2) 0%, transparent 35%);
    animation: backgroundShimmer 15s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes backgroundShimmer {
    0% {
        background-position: 0% 0%, 0% 0%, 0% 0%;
    }
    50% {
        background-position: 5% 10%, -5% 10%, 3% -10%;
    }
    100% {
        background-position: -5% -10%, 5% -10%, -3% 10%;
    }
}

/* 添加水波纹效果 */
.water-ripple {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    transform: scale(0);
    opacity: 0;
}

/* --- Sidebar Styles --- */
.sidebar {
    width: 260px;
    background-color: rgba(255, 255, 255, 0.85); /* 更透明一点 */
    color: var(--text-primary);
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px var(--shadow-color);
    flex-shrink: 0;
    z-index: 10;
    transition: all 0.3s ease;
}

/* 波浪装饰元素 - 侧边栏顶部 */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary), var(--accent-blue-tertiary));
    border-radius: 0 0 8px 8px;
    opacity: 0.8;
}

/* 历史记录标题样式 */
.history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.history-header h2 {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-small-icon {
    width: 18px;
    height: 18px;
    filter: invert(40%) sepia(30%) saturate(2000%) hue-rotate(210deg) brightness(90%) contrast(95%);
}

/* --- 导航模块样式 --- */
.nav-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to right, var(--accent-blue-primary), var(--accent-blue-secondary));
    transition: height 0.3s ease;
    opacity: 0.1;
    z-index: -1;
}

.nav-item:hover::after {
    height: 100%;
}

.nav-item:hover {
    color: var(--accent-blue-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(10, 77, 163, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-item.active {
    background: rgba(33, 150, 243, 0.15);
    color: var(--accent-blue-primary);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(10, 77, 163, 0.1);
    transform: translateY(-2px);
    animation: pulse 2s infinite;
}

.nav-item.active::after {
    height: 100%;
    opacity: 0.2;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    filter: invert(40%) sepia(20%) saturate(500%) hue-rotate(200deg) brightness(90%) contrast(85%); /* 蓝灰色 */
    transition: filter 0.3s ease, transform 0.3s ease;
    border-radius: 8px;
    transition: none;
}

.nav-item:hover .nav-icon {
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%); /* 深蓝色 */
    transform: scale(1.1);
}

.nav-item.active .nav-icon {
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%); /* 深蓝色 */
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 5px 0 15px 0;
}

#new-chat-button {
    background: linear-gradient(135deg, var(--accent-blue-primary), var(--accent-blue-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 0.9em;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

#new-chat-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s ease;
}

#new-chat-button:hover {
    box-shadow: 0 4px 12px var(--glow-color);
    transform: translateY(-2px);
}

#new-chat-button:hover::before {
    left: 100%;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    overflow-x: hidden;
    white-space: nowrap;
}

#history-list li {
    padding: 8px 10px;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 35px;
    border: 1px solid transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

#history-list li span {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 5px;
}

#history-list li:hover {
    background-color: rgba(33, 150, 243, 0.1);
    color: var(--text-primary);
    border-color: var(--border-color);
    transform: translateX(2px);
}

#history-list li.active {
    background-color: rgba(33, 150, 243, 0.15);
    color: var(--accent-blue-primary);
    font-weight: 500;
}

.delete-history-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

.delete-history-button img {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    filter: invert(40%) sepia(20%) saturate(500%) hue-rotate(200deg) brightness(90%) contrast(85%);
    transition: filter 0.3s ease;
}

#history-list li:hover .delete-history-button {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

.delete-history-button:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-50%) scale(1.1);
}

.delete-history-button:hover img {
    opacity: 1;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%);
}

/* --- Main Chat Area Styles --- */
.main-chat {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75); /* 调整透明度使背景图更可见 */
}

/* --- Matching HTML structure where chat-container exists --- */
.chat-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* --- 主内容区域样式 --- */
.main-section {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75); /* 更透明 */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.section-header {
    height: 60px;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 5;
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

/* 标题栏装饰波浪效果 */
.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary), var(--accent-blue-tertiary));
    opacity: 0.7;
}

.section-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
    background-color: transparent;
}

.content-wrapper {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    color: var(--text-primary);
}

/* --- Header Styling --- */
.chat-header {
    height: 60px;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 5;
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

/* 聊天标题栏装饰波浪效果 */
.chat-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary), var(--accent-blue-tertiary));
    opacity: 0.7;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    width: 28px;
    height: 28px;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%);
}

.chat-header h1 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--accent-blue-primary);
    position: relative;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    background-color: transparent;
    padding: 25px;
    box-sizing: border-box;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(230, 242, 255, 0.5)); /* 渐变背景 */
    scroll-behavior: smooth;
}

#message-list {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- Input Area --- */
.chat-input-area {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px var(--shadow-color);
    z-index: 5;
    max-width: 900px;
    width: 100%;
    margin: 15px auto 20px auto;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 输入区域装饰元素 */
.chat-input-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary), var(--accent-blue-tertiary));
    opacity: 0.5;
}

.chat-input-area:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.chat-input-area:focus-within::before {
    opacity: 1;
}

/* 新增输入框包装器样式 */
.input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

#user-input {
    flex-grow: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    margin: 0 10px;
    font-size: 1.1em;
    background-color: transparent;
    resize: none;
    overflow-y: auto;
    max-height: 200px;
    line-height: 1.6;
    outline: none;
    color: var(--text-primary);
    caret-color: var(--accent-blue-primary);
    min-height: 24px;
    transition: all 0.3s ease;
}

#user-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* 修复图标在悬停框中的居中问题 */
.input-action-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.input-action-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, var(--accent-blue-secondary) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s ease;
}

.input-action-button:hover {
    background-color: rgba(33, 150, 243, 0.1);
    transform: translateY(-2px);
}

.input-action-button:active::after {
    opacity: 0.3;
    transform: scale(1.5);
}

.input-action-button img {
    width: 20px;
    height: 20px;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%) opacity(0.8);
    transition: all 0.3s ease;
    z-index: 2;
    display: block; /* 确保图像作为块级元素 */
}

#send-button:disabled img,
#attachment-button:disabled img {
    filter: grayscale(1) brightness(1) opacity(0.3);
    cursor: not-allowed;
}

#send-button:disabled:hover,
#attachment-button:disabled:hover {
    background-color: transparent;
    transform: none;
}

/* Attachment Preview Area */
.attachment-preview {
    font-size: 0.9em;
    color: var(--text-secondary);
    padding: 8px 10px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 20px;
}

.attachment-preview:empty {
    display: none;
}

.attachment-preview .attachment-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.15));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    transition: all 0.3s ease;
}

.attachment-preview .attachment-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.attachment-item img {
    width: 16px;
    height: 16px;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%) opacity(0.8);
}

.attachment-preview span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 200px;
    color: var(--text-primary);
}

.remove-attachment-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.remove-attachment-button:hover {
    color: var(--accent-blue-primary);
    opacity: 1;
    transform: scale(1.1);
}

/* --- Message Bubbles --- */
.message {
    padding: 0;
    max-width: 100%;
    box-shadow: none;
    display: flex;
    align-items: flex-start;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: messageFadeIn 0.5s forwards;
    transition: opacity 0.5s ease, transform 0.5s ease;
    overflow: hidden;
}

.message::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, var(--accent-blue-primary), transparent);
    opacity: 0;
    transform: translateX(-100%);
}

.message.bot::after {
    animation: lineProgress 1.5s ease forwards;
}

@keyframes lineProgress {
    0% {
        opacity: 0.7;
        transform: translateX(-100%);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes messageFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.message-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.6;
    position: relative;
    background-color: white;
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
}

.message.user {
    justify-content: flex-end;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb); /* 蓝色渐变背景 */
    border-top-right-radius: 4px; /* 右上角尖角效果 */
    align-self: flex-end;
    position: relative;
}

/* 用户消息气泡装饰 */
.message.user .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: var(--accent-blue-secondary);
    opacity: 0.4;
    border-radius: 0 0 0 8px;
}

.message.bot {
    justify-content: flex-start;
    gap: 12px;
}

.message.bot .message-bubble {
    background-color: white;
    border-top-left-radius: 4px; /* 左上角尖角效果 */
    align-self: flex-start;
    position: relative;
}

/* 机器人消息气泡装饰 */
.message.bot .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--accent-blue-primary);
    opacity: 0.4;
    border-radius: 0 0 8px 0;
}

.bot-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    border: 2px solid var(--accent-blue-primary);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
    animation: pulseIcon 2s infinite alternate;
}

@keyframes pulseIcon {
    from {
        transform: scale(1);
        box-shadow: 0 2px 8px var(--shadow-color);
    }
    to {
        transform: scale(1.05);
        box-shadow: 0 4px 12px var(--glow-color);
    }
}

.message.bot .message-bubble img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.message.bot .message-bubble img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* --- Copy Button Below Message --- */
.copy-message-button-wrapper {
    display: flex;
    padding-top: 8px;
    width: 100%;
    box-sizing: border-box;
}

.bot-copy-wrapper {
    justify-content: flex-start;
    padding-left: 5px;
}

.user-copy-wrapper {
    justify-content: flex-end;
    padding-right: 5px;
}

.copy-message-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin: 0;
    opacity: 0;
    transition: all 0.3s ease;
    visibility: hidden;
    display: flex;
    align-items: center;
}

.message-content-wrapper:hover .copy-message-button {
    opacity: 0.8;
    visibility: visible;
}

.copy-message-button:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.copy-message-button img {
    width: 20px;
    height: 20px;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%) opacity(0.8);
    transition: all 0.3s ease;
}

.copy-message-button:hover img {
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%) opacity(1);
    transform: scale(1.1);
}

.copy-message-button .copy-feedback {
    font-size: 0.9em;
    margin-left: 6px;
    color: var(--accent-blue-primary);
}

/* --- 消息下载按钮样式 --- */
.message-buttons-container {
    display: flex;
    gap: 8px;
}

.download-message-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin: 0;
    opacity: 0;
    transition: all 0.3s ease;
    visibility: hidden;
    display: flex;
    align-items: center;
}

.message-content-wrapper:hover .download-message-button {
    opacity: 0.8;
    visibility: visible;
}

.download-message-button:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.download-message-button img {
    width: 20px;
    height: 20px;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%) opacity(0.8);
    transition: all 0.3s ease;
}

.download-message-button:hover img {
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%) opacity(1);
    transform: scale(1.1);
}

/* --- Code Blocks --- */
.message.bot pre {
    background-color: #f5f5f5;
    color: #333;
    position: relative;
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: all 0.3s ease;
}

.message.bot pre:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
    transform: translateY(-2px);
}

.message.bot pre code {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.9em;
    display: block;
    white-space: pre;
    background: none;
    color: inherit;
    padding: 1em;
    overflow-x: auto;
    border-top: 1px solid #e0e0e0;
}

/* 代码块标题栏 */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-bottom: none;
    height: 40px;
    box-sizing: border-box;
    background: linear-gradient(to right, #f0f0f0, #f5f5f5);
}

/* 代码类型标签 */
.code-type-label {
    font-size: 0.85em;
    color: #555;
    font-family: 'Segoe UI', sans-serif;
    user-select: none;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.code-type-label::before {
    content: '</>';
    margin-right: 5px;
    font-size: 0.9em;
    color: var(--accent-blue-secondary);
    font-weight: bold;
}

/* 代码块顶部按钮栏 */
.code-buttons-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 复制代码按钮和预览按钮共用样式 - 修复对齐和图标显示问题 */
.copy-code-button, .preview-html-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.copy-code-button img, .preview-html-button img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: all 0.3s ease;
    pointer-events: none; /* 防止图标干扰点击事件 */
}

.copy-code-button:hover, .preview-html-button:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.copy-code-button:hover img, .preview-html-button:hover img {
    opacity: 1;
}

/* --- 代码块下载按钮样式 --- */
.download-code-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.download-code-button img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: all 0.3s ease;
    pointer-events: none; /* 防止图标干扰点击事件 */
}

.download-code-button:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.download-code-button:hover img {
    opacity: 1;
}

/* --- HTML预览弹窗样式 --- */
.html-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.html-preview-container {
    width: 80%;
    max-width: 900px;
    height: 80%;
    background-color: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.3s ease;
    border: 1px solid var(--border-color);
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
    }
    to {
        transform: scale(1);
    }
}

.html-preview-title {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent-blue-primary), var(--accent-blue-secondary));
    color: white;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.html-preview-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0 4px;
    transition: all 0.3s ease;
}

.html-preview-close:hover {
    transform: scale(1.2);
}

.html-preview-frame {
    flex-grow: 1;
    width: 100%;
    border: none;
    background-color: #ffffff;
}

/* Thinking indicator */
.thinking-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    animation: fadeIn 0.5s ease;
}

.thinking-dots {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.thinking-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    border-radius: 50%;
    background: var(--accent-blue-primary);
    animation: thinking-dots 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) { 
    animation-delay: -0.32s; 
}

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

/* 新增美化的等待提示文本样式 */
.waiting-text {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 18px;
    margin-top: 10px;
    border-radius: 12px;
    font-size: 14px;
    color: white;
    background: linear-gradient(135deg, var(--accent-blue-primary), var(--accent-blue-secondary));
    box-shadow: 0 3px 15px rgba(10, 77, 163, 0.25);
    overflow: hidden;
    animation: pulseGlow 2.5s infinite alternate ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 添加精致的闪光效果 */
.waiting-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* 添加气泡装饰元素 */
.waiting-text::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        15px 5px 0 -1px rgba(255, 255, 255, 0.3),
        -10px 10px 0 -2px rgba(255, 255, 255, 0.2);
}

/* 图标与文本间距 */
.waiting-text img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    filter: brightness(10);
    animation: rotate360 8s linear infinite;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 3px 10px rgba(10, 77, 163, 0.15);
    }
    to {
        box-shadow: 0 5px 20px rgba(33, 150, 243, 0.4);
        transform: translateY(-2px);
    }
}

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

@keyframes thinking-dots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    40% {
        transform: scale(1.0);
        opacity: 1;
    }
}

/* 提示词卡片样式 */
.prompt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.prompt-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
}

.prompt-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prompt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(10, 77, 163, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-color: var(--accent-blue-primary);
}

.prompt-card:hover::before {
    opacity: 1;
}

.prompt-card-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f5f9ff, #eaf3ff);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-icon {
    width: 18px;
    height: 18px;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%);
    transition: transform 0.3s ease;
}

.prompt-card:hover .agent-icon {
    transform: rotate(15deg) scale(1.1);
}

.agent-badge span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-blue-primary);
    letter-spacing: 0.5px;
}

/* 复制提示词按钮样式 */
.copy-prompt-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-prompt-btn:hover {
    background-color: rgba(33, 150, 243, 0.1);
    transform: translateY(-2px);
}

.copy-prompt-btn img {
    width: 18px;
    height: 18px;
    filter: invert(40%) sepia(20%) saturate(500%) hue-rotate(200deg) brightness(90%) contrast(85%);
    transition: all 0.3s ease;
}

.copy-prompt-btn:hover img {
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%);
    transform: scale(1.1);
}

.prompt-card-content {
    padding: 15px;
    flex-grow: 1;
    position: relative;
}

.prompt-card-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

.prompt-card-content p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-primary);
    font-size: 0.95rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.prompt-card-footer {
    padding: 10px 15px 15px;
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 2;
}

.use-prompt-btn {
    background: linear-gradient(135deg, var(--accent-blue-primary), var(--accent-blue-secondary));
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.use-prompt-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s ease;
}

.use-prompt-btn:hover {
    box-shadow: 0 4px 12px var(--glow-color);
    transform: translateY(-2px);
}

.use-prompt-btn:hover::before {
    left: 100%;
}

/* --- 项目介绍区域样式 --- */
.intro-hero {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.intro-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary), var(--accent-blue-tertiary));
}

.intro-hero:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.intro-logo-container {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.intro-logo {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 2px solid var(--accent-blue-primary);
    transition: all 0.3s ease;
    animation: floating 3s infinite alternate ease-in-out;
}

@keyframes floating {
    0% {
        transform: translateY(0) rotate(0);
    }
    100% {
        transform: translateY(-5px) rotate(2deg);
    }
}

.intro-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px var(--glow-color);
    border-color: var(--accent-blue-secondary);
}

.intro-main {
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.intro-main h1 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--accent-blue-primary);
    font-size: 1.8em;
    position: relative;
    display: inline-block;
}

.intro-main h1::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary));
    border-radius: 3px;
}

.intro-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
}

.agents-title {
    font-size: 1.5em;
    color: var(--accent-blue-primary);
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.agents-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue-primary), var(--accent-blue-secondary));
    border-radius: 3px;
}

.agent-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.agent-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(to bottom, var(--accent-blue-primary), var(--accent-blue-secondary));
    transition: height 0.5s ease;
}

.agent-card:hover::before {
    height: 100%;
}

.agent-card:hover {
    transform: translateY(-5px) translateX(2px);
    box-shadow: 0 5px 15px rgba(10, 77, 163, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-color: var(--accent-blue-primary);
}

.agent-card-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f5f9ff, #eaf3ff);
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-intro-icon {
    width: 24px;
    height: 24px;
    filter: invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(95%);
    transition: transform 0.3s ease;
}

.agent-card:hover .agent-intro-icon {
    transform: rotate(15deg) scale(1.2);
}

.agent-card-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--accent-blue-primary);
}

.agent-card-content {
    padding: 15px;
}

.agent-card-content p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.agent-card:hover .agent-card-content p {
    transform: translateX(5px);
}

/* --- 图片预览模态框样式 --- */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* 深色背景增加对比度 */
    backdrop-filter: blur(5px);
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    z-index: 1001; /* 确保在其他元素上方 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-modal.active {
    display: flex;
    opacity: 1;
}

.image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.image-preview-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background-color: rgba(20, 20, 20, 0.8);
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.preview-btn img {
    width: 24px;
    height: 24px;
    filter: invert(1); /* 使SVG图标变为白色 */
    opacity: 0.8;
    transition: all 0.3s ease;
}

.preview-btn:hover img {
    opacity: 1;
}

#download-btn {
    text-decoration: none;
    color: white;
}

.image-preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-height: calc(90vh - 70px); /* 减去工具栏的高度 */
    overflow: hidden;
}

#preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: move; /* 表明图片可以移动 */
}

/* 为移动设备优化 */
@media (max-width: 768px) {
    .image-preview-toolbar {
        padding: 8px;
        gap: 8px;
    }
    
    .preview-btn {
        width: 36px;
        height: 36px;
    }
    
    .preview-btn img {
        width: 20px;
        height: 20px;
    }
}

/* --- 响应式设计增强 --- */
@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 30vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-chat, .main-section {
        height: 70vh;
    }
    
    .prompt-cards, .agent-cards {
        grid-template-columns: 1fr;
    }
    
    .intro-hero {
        flex-direction: column;
        padding: 20px;
        text-align: center;
        gap: 15px;
    }
    
    .intro-main h1::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 576px) {
    .chat-messages {
        padding: 15px 10px;
    }
    
    .message.bot {
        gap: 8px;
    }
    
    .bot-icon {
        width: 30px;
        height: 30px;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 10px 14px;
    }
    
    .chat-input-area {
        margin: 10px auto 15px auto;
    }
    
    #user-input {
        padding: 10px 5px;
        font-size: 1em;
    }
    
    .thinking-indicator {
        margin-left: 30px;
    }
}