* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.chat-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 左侧会话列表 */
.sidebar-left {
    width: 320px;
    min-width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
}

.sidebar-left.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.btn-toggle-sidebar {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-toggle-sidebar:hover {
    background: var(--bg-primary);
    color: var(--primary-light);
}

.sidebar-left.collapsed .btn-toggle-sidebar {
    width: 100%;
}

.btn-new-chat {
    flex: 1;
    padding: 12px 20px;
    background: var(--gradient-1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-new-chat-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--gradient-1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sidebar-left.collapsed .btn-new-chat {
    display: none;
}

.sidebar-left:not(.collapsed) .btn-new-chat-icon {
    display: none;
}

.btn-new-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-new-chat:active {
    transform: translateY(0);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversation-list::-webkit-scrollbar {
    width: 6px;
}

.conversation-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.conversation-list::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.conversation-item {
    padding: 16px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    border: 2px solid transparent;
}

.sidebar-left.collapsed .conversation-item {
    padding: 12px;
    justify-content: center;
}

.sidebar-left.collapsed .conversation-content {
    display: none;
}

.sidebar-left.collapsed .btn-delete {
    display: none;
}

.conversation-item:hover {
    background: #475569;
    transform: translateX(4px);
}

.conversation-item.active {
    background: var(--gradient-1);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-delete {
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0;
}

.conversation-item:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 中间聊天区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    gap: 12px;
}

.header-left-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-toggle-sidebar-header,
.btn-new-chat-header {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-toggle-sidebar-header:hover,
.btn-new-chat-header:hover {
    background: var(--bg-primary);
    color: var(--primary-light);
}

.btn-new-chat-header {
    background: var(--gradient-1);
    color: white;
}

.btn-new-chat-header:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-menu-mobile {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-menu-mobile:hover {
    background: var(--bg-primary);
    color: var(--primary-light);
}

.btn-show-notes,
.btn-show-notes-pc {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    white-space: nowrap;
    min-width: auto;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-1px);
}

.btn-logout i {
    font-size: 14px;
}

.btn-show-notes:hover,
.btn-show-notes-pc:hover {
    background: var(--bg-primary);
    color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-show-notes .badge,
.btn-show-notes-pc .badge {
    background: var(--accent);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.chat-title i {
    color: var(--primary-light);
    font-size: 20px;
}

.chat-info {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 50%;
    gap: 16px;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.user-message .message-avatar {
    background: var(--gradient-2);
}

.ai-message .message-avatar {
    background: var(--gradient-1);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 14px;
    letter-spacing: 0.01em;
}

.message-text a {
    color: var(--primary-light);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-light);
    transition: all 0.2s ease;
}

.message-text a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.message-text img {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-text img:hover {
    transform: scale(1.02);
}

.message-image-container {
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.message-image-container img {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    object-fit: contain;
    display: block;
}

.user-message .message-text {
    background: var(--gradient-1);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-text {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

.ai-message .message-time {
    text-align: left;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.input-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: var(--bg-primary);
    color: var(--primary-light);
    border-color: var(--primary-light);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.5;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.message-input:focus {
    outline: none;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gradient-1);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Image preview container */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.image-preview-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.remove-image-btn:hover:not(:disabled) {
    background: var(--danger);
    transform: scale(1.1);
}

.remove-image-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.uploading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    gap: 4px;
}

.uploading-overlay i {
    font-size: 16px;
}

/* 模型选择器样式 */
.model-select-container {
    display: flex;
    align-items: center;
}

.model-select {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 120px;
}

.model-select:hover {
    background: var(--bg-primary);
    color: var(--primary-light);
    border-color: var(--primary-light);
}

.model-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.model-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: none;
    padding: 8px 12px;
}

/* 右侧推荐信息 */
.sidebar-right {
    width: 360px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-right.hidden {
    width: 0;
    min-width: 0;
    border-left: none;
    overflow: hidden;
}

.sidebar-right .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close-right {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-right:hover {
    background: var(--danger);
    color: white;
}

.sidebar-right .sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-right .sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-right .sidebar-header h3 i {
    color: var(--primary-light);
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.notes-list::-webkit-scrollbar {
    width: 6px;
}

.notes-list::-webkit-scrollbar-track {
    background: transparent;
}

.notes-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.note-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.note-item:hover {
    background: #475569;
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.note-image {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-primary);
}

.note-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.note-keyword {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
}

.note-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.note-stats i {
    margin-right: 4px;
}

.note-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 通用确认弹窗 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.confirm-modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    padding: 32px;
    position: relative;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    font-size: 32px;
    color: white;
}

.confirm-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 12px;
}

.confirm-modal-content p {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 24px;
    letter-spacing: 0.01em;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-cancel,
.btn-confirm {
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-confirm {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* 通用信息提示 */
.toast-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 2002;
    min-width: 300px;
    max-width: 90%;
    animation: slideDown 0.3s ease;
}

.toast-message i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message span {
    font-size: 15px;
    color: var(--text-primary);
    flex: 1;
}

.toast-message.info {
    border-left: 4px solid var(--primary);
}

.toast-message.info i {
    color: var(--primary);
}

.toast-message.success {
    border-left: 4px solid var(--success);
}

.toast-message.success i {
    color: var(--success);
}

.toast-message.warning {
    border-left: 4px solid var(--warning);
}

.toast-message.warning i {
    color: var(--warning);
}

.toast-message.error {
    border-left: 4px solid var(--danger);
}

.toast-message.error i {
    color: var(--danger);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-enter-active,
.toast-leave-active {
    transition: all 0.3s ease;
}

.toast-enter-from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.toast-leave-to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* 推荐信息详情弹窗 */
.note-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* 高于推荐列表的z-index (1001) */
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.note-modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
}

/* 自定义滚动条样式 */
.note-modal-content::-webkit-scrollbar {
    width: 8px;
}

.note-modal-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin: 8px;
}

.note-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.note-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* Firefox滚动条样式 */
.note-modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-tertiary);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.note-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 15px;
}

.note-loading i {
    color: var(--primary-light);
    font-size: 18px;
}

.note-detail {
    padding: 32px;
}

.note-detail h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.note-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.note-detail-meta i {
    margin-right: 6px;
}

.note-detail-content {
    margin-bottom: 24px;
}

.note-detail-content p {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}

/* 图片展示区域 */
.note-images {
    margin-top: 24px;
    margin-bottom: 32px;
}

.image-slider {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: var(--bg-tertiary);
}

.slider-image.active {
    opacity: 1;
    z-index: 1;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn-prev {
    left: 16px;
}

.slider-btn-next {
    right: 16px;
}

.image-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.indicator {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.5); /* 使用主色调的半透明版本 */
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--primary); /* 使用主色调 */
    width: 24px;
    border-radius: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .slider-container {
        height: 300px;
    }
    
    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .slider-btn-prev {
        left: 8px;
    }
    
    .slider-btn-next {
        right: 8px;
    }
}

.note-comments {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.note-comments h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.comment-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-header strong {
    color: var(--text-primary);
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.comment-likes {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.comment-replies {
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
}

.reply-item {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.reply-item strong {
    color: var(--primary-light);
}

.note-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-1);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 24px;
}

.note-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .sidebar-right {
        width: 300px;
    }
}

@media (max-width: 1200px) {
    .sidebar-right:not(.hidden) {
        display: flex;
    }
    
    .sidebar-right.hidden {
        display: none;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    .chat-container {
        position: relative;
    }

    .sidebar-left {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar-left:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar-left.collapsed {
        width: 0;
        transform: translateX(-100%);
    }

    .btn-menu-mobile {
        display: flex !important;
    }

    .chat-main {
        width: 100%;
    }

    .chat-header {
        padding: 16px;
    }

    .chat-title {
        font-size: 16px;
    }

    .chat-title span {
        display: none;
    }

    .chat-messages {
        padding: 16px;
        gap: 16px;
    }

    .message {
        max-width: 95%;
    }

    .message-text {
        padding: 10px 12px;
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* 移动端头像只显示在一侧 */
    .message {
        position: relative;
    }
    
    .message-avatar {
        position: absolute;
        top: 0;
    }
    
    .ai-message .message-avatar {
        left: 0;
    }
    
    .user-message .message-avatar {
        right: 0;
    }
    
    /* 调整消息内容区域，使其更好地利用空间 */
    .message-content {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 根据消息类型设置不同的padding */
    .ai-message .message-content {
        padding-left: 52px; /* 为AI消息左侧头像留出空间 */
        padding-right: 2px; /* 右侧不需要太大空间 */
    }

    .user-message .message-content {
        padding-right: 52px; /* 为用户消息右侧头像留出空间 */
        padding-left: 2px; /* 左侧不需要太大空间 */
    }

    /* 调整消息文本的最大宽度 */
    .message-text {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .message-text img,
    .message-image-container {
        max-height: 200px;
    }

    .chat-input-area {
        padding: 12px 16px;
        padding-bottom: calc(48px + env(safe-area-inset-bottom));
    }

    /* 仅针对 iOS Safari 增加 padding-bottom */
    @supports (-webkit-touch-callout: none) {
        .chat-input-area {
            padding-bottom: calc(58px + env(safe-area-inset-bottom));
        }
    }


    .input-wrapper {
        padding: 10px 12px;
    }

    .message-input {
        font-size: 14px;
    }

    .sidebar-right {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 100%;
        max-width: 400px;
        z-index: 1001;
        transform: translateX(100%);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s ease;
    }

    .sidebar-right:not(.hidden) {
        transform: translateX(0);
    }

    .sidebar-right.hidden {
        transform: translateX(100%);
    }

    /* 移动端遮罩层 */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    .note-item {
        padding: 12px;
    }

    .note-image {
        height: 150px;
    }

    .note-title {
        font-size: 14px;
    }

    .note-preview {
        font-size: 12px;
    }

    .note-modal-content {
        max-width: 95%;
        max-height: 95vh;
    }

    /* 移动端滚动条样式 */
    .note-modal-content::-webkit-scrollbar {
        width: 6px;
    }

    .note-modal-content::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
        border-radius: 3px;
        margin: 4px;
    }

    .note-modal-content::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        border-radius: 3px;
    }

    .note-detail {
        padding: 20px;
    }

    .note-detail h2 {
        font-size: 20px;
    }

    /* 移动端触摸优化 */
    .conversation-item,
    .note-item,
    .btn-new-chat,
    .send-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* 移动端输入框优化 */
    .message-input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    /* 移动端确认弹窗 */
    .confirm-modal-content {
        max-width: 90%;
        padding: 24px;
    }

    .confirm-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .confirm-modal-content h3 {
        font-size: 18px;
    }

    .confirm-modal-content p {
        font-size: 14px;
    }

    .btn-cancel,
    .btn-confirm {
        padding: 10px 24px;
        font-size: 14px;
        min-width: 80px;
    }

    /* 移动端信息提示 */
    .toast-message {
        top: 16px;
        left: 16px;
        right: 16px;
        transform: none;
        max-width: none;
        min-width: auto;
        padding: 12px 20px;
    }

    .toast-message span {
        font-size: 14px;
    }
}

/* 平板端样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar-left {
        width: 280px;
    }

    .sidebar-right {
        width: 300px;
    }

    .message {
        width: 95%;
    }
}

