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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    max-width: 800px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 20px;
    border-radius: 25px 25px 0 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-header h1 {
    color: white;
    font-size: 1.5rem;
    text-align: center;
    margin: 0;
    flex: 1;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
    position: relative;
}

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

.message.user {
    align-items: flex-end;
}

.message-content {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.user .message-content {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot .message-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* 添加时间戳样式 */
.message::after {
    display: none; /* 隐藏时间戳 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .message-content {
        max-width: 85%;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .chat-messages {
        padding: 15px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .chat-messages {
        background: rgba(30, 32, 42, 0.95);
    }

    .bot .message-content {
        background: linear-gradient(135deg, #2a2a4a 0%, #1a1c2c 100%);
        color: #fff;
    }
}

.chat-input {
    background: rgba(255, 255, 255, 0.98);
    padding: 15px;
    border-top: 1px solid rgba(106, 17, 203, 0.1);
    display: flex;
    gap: 10px;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#userInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid rgba(106, 17, 203, 0.2);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(106, 17, 203, 0.1);
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-user-select: text;
    user-select: text;
    -webkit-tap-highlight-color: transparent;
}

#userInput:hover {
    border-color: rgba(106, 17, 203, 0.3);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.15);
}

#userInput:focus {
    border-color: rgba(106, 17, 203, 0.5);
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.2);
    background: #ffffff;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    #userInput {
        background: rgba(30, 32, 42, 0.95);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    #userInput:hover {
        border-color: rgba(255, 255, 255, 0.3);
        background: rgba(40, 42, 52, 0.95);
    }

    #userInput:focus {
        border-color: rgba(255, 255, 255, 0.4);
        background: rgba(50, 52, 62, 0.95);
    }

    .chat-input {
        background: rgba(20, 22, 32, 0.98);
    }
}

#sendButton {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
}

#sendButton:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.settings-button {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: transform 0.3s ease;
}

.settings-button:hover {
    transform: translateY(-50%) rotate(45deg);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1c2d 0%, #2d1f3d 100%);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    color: #fff;
}

.settings-panel.active {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.5em;
}

.close-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.close-button:hover {
    transform: rotate(90deg);
}

.setting-item {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.setting-item select,
.setting-item input[type="text"],
.setting-item input[type="password"] {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    transition: all 0.3s ease;
}

.setting-item select:hover,
.setting-item input[type="text"]:hover,
.setting-item input[type="password"]:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.setting-item select:focus,
.setting-item input[type="text"]:focus,
.setting-item input[type="password"]:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

.test-api-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-top: 15px;
}

.test-api-button:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.test-api-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.model-settings {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 15px;
    padding: 20px;
}

.model-settings h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.model-selection {
    margin-bottom: 20px;
}

.model-selection select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px;
    width: 100%;
    color: #fff;
    cursor: pointer;
}

.api-settings {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-top: 15px;
}

.api-settings .setting-group {
    margin-bottom: 15px;
}

.api-settings input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    transition: all 0.3s ease;
}

.api-settings input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.test-button-container {
    padding: 15px;
    margin-top: -10px;
    text-align: center;
}

.test-button {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.test-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chat-input {
        padding: 10px;
    }

    #sendButton {
        padding: 12px 20px;
        min-width: 60px;
    }

    .test-button {
        width: 90%;
        max-width: 300px;
    }
}

/* 调整设置面板在移动端的布局 */
@media (max-width: 768px) {
    .settings-panel {
        width: 100%;
        right: -100%;
        border-radius: 0;
    }

    .settings-header {
        padding: 12px 15px;
    }

    .settings-content {
        padding: 12px;
    }

    .setting-item {
        margin-bottom: 12px;
    }

    /* 头像选择部分 */
    .avatar-setting {
        margin-bottom: 15px;
    }

    .preset-avatars {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }

    .avatar-option {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        border-radius: 50%;
    }

    /* 滑块设置 */
    .setting-item label {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .setting-item input[type="range"] {
        margin: 8px 0;
        height: 24px;
    }

    .setting-item span {
        font-size: 12px;
    }

    /* 测试按钮 */
    .test-button {
        position: relative;
        margin: 15px auto;
        padding: 10px 20px;
        font-size: 15px;
        width: calc(100% - 24px);
        max-width: none;
    }
}

/* 确保设置面板内容可滚动 */
.settings-content {
    max-height: calc(100vh - 60px); /* 减去头部高度 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 录音按钮基础样式 */
.voice-button {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.5) 0%, rgba(51, 133, 255, 0.5) 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    box-shadow: 0 2px 6px rgba(0, 102, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.voice-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 102, 255, 0.3);
    background: linear-gradient(135deg, rgba(0, 82, 204, 0.6) 0%, rgba(26, 117, 255, 0.6) 100%);
}

.voice-button:active {
    transform: scale(0.95);
}

/* 录音状态样式 */
.voice-button.recording {
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.5) 0%, rgba(255, 0, 0, 0.5) 100%);
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.5);
    animation: recording-pulse 1.5s ease-in-out infinite;
}

/* 增强的脉冲动画 */
@keyframes recording-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px 12px rgba(255, 0, 0, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
        transform: scale(1);
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .voice-button {
        background: linear-gradient(135deg, rgba(0, 102, 255, 0.5) 0%, rgba(51, 133, 255, 0.5) 100%);
        box-shadow: 0 2px 6px rgba(0, 102, 255, 0.3);
    }

    .voice-button:hover {
        background: linear-gradient(135deg, rgba(0, 82, 204, 0.6) 0%, rgba(26, 117, 255, 0.6) 100%);
        box-shadow: 0 4px 8px rgba(0, 102, 255, 0.4);
    }

    .voice-button.recording {
        background: linear-gradient(135deg, rgba(255, 51, 51, 0.5) 0%, rgba(255, 0, 0, 0.5) 100%);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.5);
    }
}

/* 禁用状态 */
.voice-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 数字人形象样式 */
.avatar-container {
    padding: 20px;
    background: linear-gradient(180deg, #e6f3ff 0%, #ffffff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 60px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.avatar-wrapper:hover .avatar-image {
    transform: scale(1.05);
}

.avatar-animation {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-animation.speaking {
    opacity: 1;
}

/* 声波动画 */
.sound-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    gap: 12px;
    padding: 0 30px;
    background: rgba(0, 132, 255, 0.1);
    border-radius: 40px;
}

.sound-wave span {
    width: 8px;
    height: 30px;
    background-color: rgba(0, 132, 255, 0.8);
    border-radius: 4px;
    transition: all 0.1s ease;
    transform-origin: bottom;
}

.avatar-animation.speaking .sound-wave span {
    animation: sound-wave-animation 0.5s infinite ease-in-out;
}

/* 为每个条设置不同的初始高度和动画延迟 */
.sound-wave span:nth-child(1) { 
    animation-delay: 0.0s;
    height: 20px;
}
.sound-wave span:nth-child(2) { 
    animation-delay: 0.1s;
    height: 40px;
}
.sound-wave span:nth-child(3) { 
    animation-delay: 0.2s;
    height: 60px;
}
.sound-wave span:nth-child(4) { 
    animation-delay: 0.3s;
    height: 40px;
}
.sound-wave span:nth-child(5) { 
    animation-delay: 0.4s;
    height: 20px;
}

/* 添加更多声波条 */
.sound-wave::before,
.sound-wave::after {
    content: '';
    width: 8px;
    height: 15px;
    background-color: rgba(0, 132, 255, 0.8);
    border-radius: 4px;
}

@keyframes sound-wave-animation {
    0% {
        transform: scaleY(0.8);
    }
    50% {
        transform: scaleY(1.5);
    }
    100% {
        transform: scaleY(0.8);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        border-radius: 0;
        height: 100vh;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
}

/* 头像设置样式 */
.avatar-setting {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.avatar-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.preset-avatars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.avatar-option {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background-color: white;
    padding: 2px;
}

.avatar-option:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.2);
}

.avatar-option.selected {
    border-color: #0084ff;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
}

.custom-avatar {
    margin-top: 10px;
}

.upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upload-button:hover {
    background: linear-gradient(135deg, #5a0cb7 0%, #1565e8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.upload-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 角色选择样式 */
.role-setting {
    margin-bottom: 30px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.role-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.role-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.role-card.selected {
    border-color: var(--primary-color, #6a11cb);
    background: rgba(106, 17, 203, 0.05);
}

.role-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: transform 0.3s ease;
    background: white;
    padding: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.role-card:hover img {
    transform: scale(1.1);
}

.role-card span {
    display: block;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

.role-card.selected span,
.role-card.custom-saved span {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .role-grid {
        grid-template-columns: 1fr;
    }
    
    .role-card {
        padding: 15px;
    }
    
    .role-card img {
        width: 60px;
        height: 60px;
    }
}

/* 角色切换动画 */
.avatar-container {
    position: relative;
}

.avatar-image {
    transition: all 0.3s ease;
}

.avatar-image.switching {
    transform: scale(0.8);
    opacity: 0;
}

/* 主题颜色变量 */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .role-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .role-grid {
        grid-template-columns: 1fr;
    }
}

/* 头像说话动画 */
.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 60px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* 说话时的头像动画 */
@keyframes subtle-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.02);
    }
}

.avatar-wrapper.speaking .avatar-image {
    animation: subtle-bounce 1s ease-in-out infinite;
}

/* 说话时的光环效果 */
.avatar-wrapper::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 60px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.avatar-wrapper.speaking::after {
    opacity: 0.3;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.05);
    }
}

/* 声波动画容器 */
.sound-wave-container {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.avatar-wrapper.speaking .sound-wave-container {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.sound-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.sound-wave span {
    width: 3px;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    animation: sound-wave 0.5s ease infinite;
}

.sound-wave span:nth-child(1) { animation-delay: 0.1s; }
.sound-wave span:nth-child(2) { animation-delay: 0.2s; }
.sound-wave span:nth-child(3) { animation-delay: 0.3s; }
.sound-wave span:nth-child(4) { animation-delay: 0.4s; }
.sound-wave span:nth-child(5) { animation-delay: 0.5s; }

@keyframes sound-wave {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* 在PC端使用更宽的消息框 */
@media (min-width: 768px) {
    .message-content {
        max-width: 90%;
    }
    
    .chat-container {
        max-width: 1000px;  /* 增加整体容器宽度 */
    }
}

/* 移动端保持原有宽度 */
@media (max-width: 768px) {
    .message-content {
        max-width: 85%;
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* 知识库管理样式 */
.knowledge-base {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.knowledge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.knowledge-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.knowledge-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.knowledge-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.knowledge-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 102, 255, 0.1);
    border-radius: 8px;
    color: #0066ff;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.file-meta {
    font-size: 0.8rem;
    color: #666;
}

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

.action-button {
    padding: 6px;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.action-button.delete:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff3333;
}

.upload-knowledge {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.5) 0%, rgba(51, 133, 255, 0.5) 100%);
    border: 2px dashed rgba(0, 102, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.upload-knowledge:hover {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.6) 0%, rgba(51, 133, 255, 0.6) 100%);
    border-color: rgba(0, 102, 255, 0.5);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 24px;
    color: white;
}

.upload-text {
    color: white;
    font-size: 0.9rem;
    text-align: center;
}

.file-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background: white;
    transition: width 0.3s ease;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .knowledge-title {
        color: #fff;
    }

    .knowledge-list {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .knowledge-item {
        background: rgba(255, 255, 255, 0.05);
    }

    .file-name {
        color: #fff;
    }

    .file-meta {
        color: #999;
    }

    .action-button {
        color: #999;
    }

    .action-button:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .action-button.delete:hover {
        background: rgba(255, 0, 0, 0.2);
        color: #ff4444;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .knowledge-list {
        max-height: 250px;
    }

    .knowledge-item {
        padding: 10px;
    }

    .file-icon {
        width: 28px;
        height: 28px;
    }

    .file-name {
        font-size: 0.9rem;
    }

    .file-meta {
        font-size: 0.75rem;
    }

    .upload-knowledge {
        padding: 12px;
    }
}

/* 文件预览样式 */
.file-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    animation: fadeIn 0.3s ease;
}

.preview-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.preview-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.preview-header button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.preview-header button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.preview-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.preview-body pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

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

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .preview-content {
        background: #1a1c2c;
    }

    .preview-header {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .preview-header h3 {
        color: #fff;
    }

    .preview-header button {
        color: #999;
    }

    .preview-header button:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .preview-body pre {
        color: #fff;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .preview-content {
        width: 95%;
        max-height: 85vh;
    }

    .preview-header {
        padding: 12px 15px;
    }

    .preview-body {
        padding: 15px;
    }

    .preview-body pre {
        font-size: 0.85rem;
    }
}

/* 编辑器样式 */
.editor-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.save-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.save-button:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-1px);
}

.file-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.file-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .file-editor {
        background: rgba(30, 32, 42, 0.95);
        color: #fff;
        border-color: #444;
    }
    
    .file-editor:focus {
        border-color: var(--primary-color);
    }
}

/* 自定义角色设置样式 */
.custom-role-settings {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.setting-group input[type="text"],
.setting-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.setting-group textarea {
    resize: vertical;
    min-height: 100px;
}

.setting-group input[type="text"]:focus,
.setting-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.1);
    outline: none;
}

.color-pickers {
    display: flex;
    gap: 10px;
}

.color-pickers input[type="color"] {
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.save-custom-role {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-custom-role:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.role-card.custom img {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .custom-role-settings {
        background: rgba(0, 0, 0, 0.2);
    }

    .setting-group label {
        color: #fff;
    }

    .setting-group input[type="text"],
    .setting-group textarea {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .setting-group input[type="text"]:focus,
    .setting-group textarea:focus {
        border-color: var(--primary-color);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .custom-role-settings {
        padding: 15px;
    }

    .setting-group input[type="text"],
    .setting-group textarea {
        font-size: 16px;
    }
}

.role-card.custom-saved {
    position: relative;
    background: linear-gradient(135deg, attr(data-primary) 0%, attr(data-secondary) 100%);
}

/* 添加新的样式规则来处理自定义角色卡片的背景 */
.role-card.custom-saved[style*="--card-primary"] {
    background: linear-gradient(135deg, 
        var(--card-primary, #6a11cb) 0%, 
        var(--card-secondary, #2575fc) 100%
    );
}

.role-card.custom-saved.selected {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--card-primary, #6a11cb);
}

.role-card.custom-saved span {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.role-card.custom-saved .delete-role {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
}

.role-card.custom-saved:hover .delete-role {
    opacity: 1;
}

.role-card.custom-saved .delete-role:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(1.1);
}

.role-card.custom-saved.selected {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--card-primary, #6a11cb);
}

@media (max-width: 768px) {
    .role-card.custom-saved .delete-role {
        opacity: 1;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* 语音按钮提示样式 */
.voice-button-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: normal;
    max-width: 140px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    margin-bottom: 8px;
    text-align: center;
    width: max-content;
}

.voice-button-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.voice-button:hover .voice-button-tooltip {
    opacity: 1;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .voice-button-tooltip {
        background: rgba(255, 255, 255, 0.9);
        color: #333;
    }

    .voice-button-tooltip::after {
        border-color: rgba(255, 255, 255, 0.9) transparent transparent transparent;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .voice-button-tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 110px;
    }
}

/* 模型设置样式 */
.model-settings {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.model-settings h3 {
    margin-bottom: 15px;
    color: #fff;
    font-size: 1.1em;
}

.model-selection {
    margin-bottom: 15px;
}

.model-selection select {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    margin-top: 5px;
}

.api-settings {
    padding: 10px 0;
}

.api-settings .setting-group {
    margin-bottom: 12px;
}

.api-settings input {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    margin-top: 5px;
}

.api-settings input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.test-api-button {
    width: 100%;
    padding: 8px;
    background: #4CAF50;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.test-api-button:hover {
    background: #45a049;
}

.api-settings input[readonly] {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.7;
}

.api-settings input[readonly]:hover,
.api-settings input[readonly]:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.api-settings input[type="password"] {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.api-settings input[type="password"]:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.api-settings input[type="password"]:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.test-api-button,
.apply-api-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.test-api-button {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.apply-api-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.test-api-button:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.apply-api-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.test-api-button:active,
.apply-api-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.test-api-button:disabled,
.apply-api-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 对话模式设置样式 */
.chat-mode-setting {
    margin: 30px 0;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.mode-card {
    padding: 15px;
    text-align: center;
    background-color: #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
    border: 1px solid #ddd;
}

.mode-card:hover {
    background-color: #e0e0e0;
    transform: translateY(-5px);
}

.mode-card.selected {
    background-color: #5a9cff;
    color: white;
}

.mode-card i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
    color: #1a73e8;
}

.mode-card span {
    font-size: 14px;
    color: #333;
}

/* 会议模式卡片的特殊样式 */
.mode-card[data-mode="meeting"] {
    background-color: #f0f8ff;
    border: 1px dashed #1a73e8;
}

.mode-card[data-mode="meeting"]:hover {
    background-color: #e0f0ff;
}

/* 清除浮动 */
.chat-messages::after {
    content: '';
    display: table;
    clear: both;
}

/* 确保消息容器可以正确显示浮动元素 */
.chat-messages {
    overflow-y: auto;
    padding: 20px;
}

.message-content p {
    text-indent: 2em;  /* 设置段落缩进为2个字符 */
    margin: 0.5em 0;   /* 设置段落间距 */
}

/* 声音选择下拉框样式 */
select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: #ffffff;  /* 改为纯白色背景 */
    color: #333;  /* 深色文字 */
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:hover {
    border-color: #aaa;
    background-color: #f8f9fa;
}

select:focus {
    outline: none;
    border-color: #6a11cb;
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.1);
    background-color: #ffffff;
}

/* 下拉选项的样式 */
select option {
    background-color: #ffffff;  /* 选项背景色 */
    color: #333;  /* 选项文字颜色 */
    padding: 8px;
}

select option:hover,
select option:focus,
select option:active,
select option:checked {
    background-color: #6a11cb;
    color: #ffffff;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    select {
        background-color: #2c2c2c;
        color: #ffffff;
        border-color: #444;
    }

    select:hover {
        background-color: #3a3a3a;
        border-color: #555;
    }

    select:focus {
        background-color: #2c2c2c;
        border-color: #6a11cb;
    }

    select option {
        background-color: #2c2c2c;
        color: #ffffff;
    }

    select option:hover,
    select option:focus,
    select option:active,
    select option:checked {
        background-color: #6a11cb;
        color: #ffffff;
    }
}

/* 声音选择标签样式 */
.voice-select-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #333;
}

@media (prefers-color-scheme: dark) {
    .voice-select-label {
        color: #ffffff;
    }
}

/* 停止生成按钮样式 */
.stop-generation-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    opacity: 0.9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stop-generation-btn:hover {
    background-color: #d32f2f;
    opacity: 1;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
}

.stop-generation-btn:active {
    transform: scale(0.97);
}

.stop-generation-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* 移动端适配样式 */
@media (max-width: 768px) {
    /* 基本布局调整 */
    body {
        margin: 0;
        padding: 0;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
    }
    
    .chat-container {
        flex-direction: column;
        max-width: 100%;
        width: 100%;
        height: 100vh;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    /* 头像区域调整 */
    .avatar-container {
        position: relative;
        width: 100%;
        height: auto;
        padding: 10px 0;
        display: flex;
        justify-content: center;
    }
    
    .avatar-wrapper {
        width: 80px;
        height: 80px;
    }
    
    /* 聊天区域调整 */
    .chat-header {
        position: relative;
        width: 100%;
        padding: 10px;
        justify-content: space-between;
    }
    
    .chat-messages {
        max-height: calc(100vh - 180px);
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .chat-input {
        margin: 5px 10px 10px;
        padding: 5px 8px;
    }
    
    /* 录音按钮样式 */
    .voice-button {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* 设置面板调整 */
    .settings-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .settings-panel.active {
        transform: translateX(0);
    }
    
    .settings-content {
        padding: 15px;
        height: calc(100vh - 60px);
    }
    
    /* 触摸反馈样式 */
    .touch-active {
        opacity: 0.7;
        transform: scale(0.98);
    }
    
    /* 兼容性修复 */
    input, textarea, select {
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    
    /* 提高可点击区域 */
    button, select, .role-card, input[type="range"] {
        touch-action: manipulation;
    }
}

/* 微信浏览器特有样式 */
.wechat-browser .chat-input {
    z-index: 100;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom, 8px);
}

/* 横屏适配 */
@media (max-width: 768px) and (orientation: landscape) {
    .avatar-container {
        display: none;
    }
    
    .chat-messages {
        max-height: calc(100vh - 100px);
    }
    
    .role-grid, .mode-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 键盘显示时的样式调整 */
body.keyboard-visible .chat-messages {
    max-height: 40vh;
}

body.keyboard-visible .avatar-container {
    display: none;
}

/* 复制按钮样式 */
.copy-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
    border: 1px solid rgba(106, 17, 203, 0.15);
    border-radius: 20px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6a11cb;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(5px) scale(0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(106, 17, 203, 0.1);
}

.bot .message-content {
    position: relative;
}

.bot .message-content:hover .copy-button {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(106, 17, 203, 0.1);
    }
    50% {
        box-shadow: 0 2px 12px rgba(106, 17, 203, 0.2);
    }
}

.copy-button:hover {
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.1) 0%, rgba(106, 17, 203, 0.15) 100%);
    border-color: rgba(106, 17, 203, 0.3);
    color: #6a11cb;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.2);
}

.copy-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(106, 17, 203, 0.15);
}

.copy-button i {
    transition: transform 0.2s ease;
}

.copy-button:hover i {
    transform: scale(1.1);
}

/* 复制提示框样式 */
.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-toast.success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.95) 0%, rgba(32, 201, 151, 0.95) 100%);
}

.copy-toast.error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.95) 0%, rgba(253, 126, 20, 0.95) 100%);
}

.copy-toast i {
    font-size: 16px;
    animation: bounceIn 0.6s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .copy-button {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .copy-button:hover {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.2) 100%);
        border-color: rgba(255, 255, 255, 0.35);
        color: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .bot .message-content:hover .copy-button {
        animation: subtlePulseDark 2s ease-in-out infinite;
    }
}

@keyframes subtlePulseDark {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .copy-button {
        width: 36px;
        height: 36px;
        font-size: 15px;
        bottom: 8px;
        right: 8px;
        border-radius: 18px;
    }
    
    .copy-button:hover {
        transform: translateY(-1px) scale(1.03);
    }
    
    .copy-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* 链接展示样式 */
.link-display-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.05) 0%, rgba(106, 17, 203, 0.08) 100%);
    border: 1px solid rgba(106, 17, 203, 0.1);
    border-radius: 8px;
    animation: fadeInUp 0.3s ease;
}

.link-title-badge {
    display: inline-block;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 24px;
    border-radius: 32px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(106, 17, 203, 0.10);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    outline: none;
    border: none;
    text-align: center;
    letter-spacing: 1px;
    user-select: text;
}

.link-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
    background: #f5f6fa;
    border: 1px solid #e0e0e0;
}

.link-item:last-child {
    margin-bottom: 0;
}

.link-item:hover {
    background: #e6e8f3;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(106, 17, 203, 0.10);
}

.link-text {
    flex: 1;
    font-size: 15px;
    color: #222;
    text-decoration: none;
    word-break: break-word;
    line-height: 1.4;
    font-weight: 500;
}

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

/* 深色模式下的链接展示样式 */
@media (prefers-color-scheme: dark) {
    .link-display-container {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.08) 100%);
        border-color: rgba(255, 255, 255, 0.15);
    }
    .link-item {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    .link-item:hover {
        background: rgba(255, 255, 255, 0.15);
    }
    .link-text {
        color: #fff;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .link-display-container {
        margin-top: 6px;
        padding: 6px 10px;
    }
    .link-item {
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    .link-text {
        font-size: 14px;
    }
}