:root {
    --bg-color: #ffffff;
    --border-color: #e5e7eb;
}

.dark {
    --bg-color: #000000;
    --border-color: #363636;
    --text-color: #e5e7eb;
    --button-bg: #2d2d2d;
    --button-hover-bg: #404040;
    --button-border: #404040;
    --primary-button-bg: #3b82f6;
    --primary-button-hover-bg: #2563eb;
    --primary-button-border: #3b82f6;
    --secondary-button-bg: #374151;
    --secondary-button-hover-bg: #4b5563;
    --secondary-button-border: #4b5563;
    --scrollbar-thumb-bg: rgba(54, 54, 54, 0.5);
    --scrollbar-thumb-hover-bg: rgba(54, 54, 54, 0.8);
    --modal-bg: #1a1a1a;
    --modal-border: #363636;
    --input-bg: #2d2d2d;
    --input-border: #404040;
    --input-focus-border: #3b82f6;
    --button-padding: 0.5rem 1rem;
    --button-font-size: 0.875rem;
    --button-line-height: 1.25rem;
    --button-radius: 0.375rem;
}

/* 基础动画 */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
        background-color: #3b82f6;
    }
    50% {
        transform: scale(1.05);
        background-color: #2563eb;
    }
    100% {
        transform: scale(1);
        background-color: #3b82f6;
    }
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.5;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-8px);
    }
    70% {
        transform: translateY(-4px);
    }
    90% {
        transform: translateY(-2px);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(2deg);
    }
    66% {
        transform: translateY(-5px) rotate(-1deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* 通用样式 */
.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* 聊天消息样式 */
.chat-message-user {
    background-color: #3b82f6;
    color: white;
    border-radius: 12px 12px 0 12px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease-out;
    position: relative;
    display: inline-block;
    max-width: 80%;
    margin-left: auto;
    padding: 12px 16px;
    text-align: right;
    float: right;
    clear: both;
    z-index: 10;
}

.chat-message-ai {
    background-color: #f3f4f6;
    color: #000000;
    border-radius: 12px 12px 12px 0;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease-out;
    position: relative;
    display: inline-block;
    max-width: 80%;
    margin-right: auto;
    padding: 12px 16px;
    text-align: left;
    float: left;
    clear: both;
    z-index: 10;
}

/* 消息容器样式 */
#chat-messages {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 暗黑主题下的消息容器样式 */
.dark #chat-messages {
    background-color: transparent !important;
    color: #f3f4f6 !important;
}

/* 强制聊天容器背景适配暗黑主题 */
.dark #chat {
    background-color: #000000 !important;
    color: #f5f5f5 !important;
}

.dark .chat-container {
    background-color: #000000 !important;
}

/* 强制主要内容区域背景适配暗黑主题 */
.dark main {
    background-color: transparent !important;
}

.dark #main-container {
    background-color: #000000 !important;
}

/* 收藏按钮样式 */
.favorite-btn {
    opacity: 0;
    transition: all 0.2s ease-in-out;
    position: absolute;
    top: -32px;
    right: -32px;
    padding: 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;  /* text-gray-400 */
}

.favorite-btn svg {
    width: 16px;
    height: 16px;
    fill: none;  /* 移除填充 */
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.favorite-btn.active svg {
    fill: #fbbf24;  /* text-yellow-400 */
    stroke: #fbbf24;  /* text-yellow-400 */
    stroke-width: 1.5;
}

.chat-message-user:hover .favorite-btn,
.chat-message-ai:hover .favorite-btn,
.chat-message-user.show-favorite .favorite-btn,
.chat-message-ai.show-favorite .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: #fbbf24;  /* text-yellow-400 */
}

.dark .favorite-btn {
    background-color: rgba(31, 41, 55, 0.5);  /* gray-800 with 50% opacity */
    color: #e5e7eb;  /* text-gray-200 更亮的颜色 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark .favorite-btn:hover {
    background-color: rgba(31, 41, 55, 0.8);  /* gray-800 with 80% opacity */
    color: #fbbf24;  /* text-yellow-400 */
    transform: scale(1.1);
}

.dark .favorite-btn.active {
    background-color: rgba(31, 41, 55, 0.8);  /* gray-800 with 80% opacity */
}

.dark .favorite-btn.active svg {
    fill: #fbbf24;  /* text-yellow-400 */
    stroke: #fbbf24;  /* text-yellow-400 */
    stroke-width: 1.5;
}

/* 图片消息中的收藏按钮样式 */
.image-container .favorite-btn {
    top: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.9);
}

.image-container .favorite-btn:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 1);
}

.dark .image-container .favorite-btn {
    background-color: rgba(31, 41, 55, 0.9);
}

.dark .image-container .favorite-btn:hover {
    background-color: rgba(31, 41, 55, 1);
}

/* 确保收藏按钮在消息内容之上 */
.chat-bubble {
    position: relative;
    overflow: visible;  /* 确保按钮不会被裁剪 */
}

/* 深色模式适配 - 使用 !important 确保覆盖 Tailwind CSS */
.dark .chat-message-ai {
    background-color: #262626 !important;
    color: #f3f4f6 !important;
}

.dark .chat-message-user {
    background-color: #1e40af !important;
    color: #ffffff !important;
}

.dark .chat-message-system {
    background-color: #262626 !important;
    color: #9ca3af !important;
}

.dark .chat-message-error {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

.dark .chat-message-image {
    background-color: rgba(55, 65, 81, 0.5) !important;
}

/* 确保动态创建的系统消息也正确适配 */
.dark .text-red-500 {
    color: #fca5a5 !important;
}

.dark .text-gray-400 {
    color: #9ca3af !important;
}

.dark .text-gray-500 {
    color: #a8a8a8 !important;
}

.dark .text-gray-600 {
    color: #a8a8a8 !important;
}

.dark .text-gray-700 {
    color: #a8a8a8 !important;
}

.dark .text-gray-800 {
    color: #f5f5f5 !important;
}

.dark .text-gray-900 {
    color: #111827 !important;
}

/* 确保动态创建的消息元素正确适配 */
.dark .chat-message {
    color: #f3f4f6 !important;
}

.dark .chat-message p {
    color: inherit !important;
}

.dark .chat-message div {
    color: inherit !important;
}

.dark .chat-message span {
    color: inherit !important;
}

/* 头部区域的暗黑主题适配 */
.dark #chat-header-name {
    color: #f3f4f6 !important;
}

.dark #chat-header-age,
.dark #chat-header-personality,
.dark #chat-header-style {
    color: #9ca3af !important;
}

.dark #chat-header-intimacy,
.dark #chat-header-chat-count,
.dark #chat-header-gift-count,
.dark #chat-header-tasks {
    color: #f3f4f6 !important;
}

/* 确保所有文本类元素在暗黑主题下可见 */
.dark .text-sm {
    color: #d1d5db !important;
}

.dark .text-xs {
    color: #9ca3af !important;
}

.dark .text-lg {
    color: #f3f4f6 !important;
}

.dark .text-xl {
    color: #ffffff !important;
}

.dark .text-2xl {
    color: #ffffff !important;
}

.dark .font-bold {
    color: #ffffff !important;
}

.dark .font-medium {
    color: #f3f4f6 !important;
}

/* 确保文本内容也能正确显示暗黑主题 */
.dark .chat-message-ai .message-content,
.dark .chat-message-ai .typewriter-text {
    color: #f3f4f6 !important;
}

.dark .chat-message-user .message-content,
.dark .chat-message-user .typewriter-text {
    color: #ffffff !important;
}

.dark .chat-message-system .message-content {
    color: #9ca3af !important;
}

.dark .chat-message-error .message-content {
    color: #fca5a5 !important;
}

/* Markdown 内容的暗黑主题适配 */
.dark .chat-message-ai .markdown-body,
.dark .chat-message-ai .markdown-body p,
.dark .chat-message-ai .markdown-body span,
.dark .chat-message-ai .markdown-body div {
    color: #f3f4f6 !important;
}

.dark .chat-message-user .markdown-body,
.dark .chat-message-user .markdown-body p,
.dark .chat-message-user .markdown-body span,
.dark .chat-message-user .markdown-body div {
    color: #ffffff !important;
}

.dark .chat-message-system .markdown-body,
.dark .chat-message-system .markdown-body p,
.dark .chat-message-system .markdown-body span,
.dark .chat-message-system .markdown-body div {
    color: #9ca3af !important;
}

/* 确保所有子元素都继承正确的颜色 */
.dark .chat-message-ai * {
    color: inherit !important;
}

.dark .chat-message-user * {
    color: inherit !important;
}

.dark .chat-message-system * {
    color: inherit !important;
}

/* 模态窗口的暗黑主题文字适配 */
.dark .modal-content {
    background-color: #000000 !important;
    color: #f3f4f6 !important;
}

.dark .modal-content h1,
.dark .modal-content h2,
.dark .modal-content h3,
.dark .modal-content h4,
.dark .modal-content h5,
.dark .modal-content h6 {
    color: #f3f4f6 !important;
}

.dark .modal-content p,
.dark .modal-content span,
.dark .modal-content div {
    color: #d1d5db !important;
}

.dark .modal-content label {
    color: #f3f4f6 !important;
}

.dark .modal-content input,
.dark .modal-content textarea,
.dark .modal-content select {
    background-color: #262626 !important;
    color: #f3f4f6 !important;
    border-color: #363636 !important;
}

.dark .modal-content input::placeholder,
.dark .modal-content textarea::placeholder {
    color: #9ca3af !important;
}

/* 侧栏文字清晰度增�?*/
.dark .gf-item {
    color: #f3f4f6 !important;
}

.dark .gf-item h3 {
    color: #ffffff !important;
}

.dark .gf-item p {
    color: #d1d5db !important;
}

.dark .gf-item .text-gray-500 {
    color: #9ca3af !important;
}

.dark .gf-item .text-gray-400 {
    color: #a8a8a8 !important;
}

/* 深色模式下角色卡片悬停效果修复 */
.dark .gf-item:hover {
    background-color: rgba(55, 65, 81, 0.3) !important;
    box-shadow: none;
}

.dark .gf-item.selected {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-left-color: rgb(96, 165, 250) !important;
}

/* 确保深色模式下角色卡片悬停时文字依然清晰 */
.dark .gf-item:hover h3 {
    color: #ffffff !important;
}

.dark .gf-item:hover p {
    color: #e5e7eb !important;
}

.dark .gf-item:hover .text-gray-500,
.dark .gf-item:hover .text-gray-400 {
    color: #d1d5db !important;
}

/* 右侧栏文字清晰度 */
.dark .menu-item {
    color: #f3f4f6 !important;
}

.dark .menu-item:hover {
    color: #ffffff !important;
}

.dark .menu-item.active {
    color: #ffffff !important;
}

/* 强制侧栏所有文字在暗黑主题下清�?*/
.dark aside {
    color: #f5f5f5 !important;
    background-color: #262626 !important;
}

.dark aside h1,
.dark aside h2,
.dark aside h3,
.dark aside h4,
.dark aside h5,
.dark aside h6 {
    color: #f5f5f5 !important;
}

.dark aside p {
    color: #a8a8a8 !important;
}

.dark aside span {
    color: #a8a8a8 !important;
}

.dark aside div {
    color: inherit !important;
}

/* 强制侧栏按钮文字清晰 */
.dark aside button {
    color: #f5f5f5 !important;
}

.dark aside .text-gray-500 {
    color: #a8a8a8 !important;
}

.dark aside .text-gray-400 {
    color: #a8a8a8 !important;
}

.dark aside .text-gray-600 {
    color: #a8a8a8 !important;
}

/* 强制用户等级显示文字清晰 */
.dark #user-level-display {
    color: #f3f4f6 !important;
}

.dark #user-level-display .text-sm {
    color: #d1d5db !important;
}

.dark #user-level-display .text-xs {
    color: #9ca3af !important;
}

/* 确保所有按钮文字在暗黑主题下清�?*/
.dark button {
    background-color: var(--button-bg);
    border: 1px solid var(--button-border);
    color: var(--text-color);
    padding: var(--button-padding);
    font-size: var(--button-font-size);
    line-height: var(--button-line-height);
    border-radius: var(--button-radius);
    transition: all 0.2s ease-in-out;
}

.dark button:hover {
    background-color: var(--button-hover-bg);
}

.dark .btn-primary {
    background-color: var(--primary-button-bg);
    border-color: var(--primary-button-border);
}

.dark .btn-primary:hover {
    background-color: var(--primary-button-hover-bg);
}

.dark .btn-secondary {
    background-color: var(--secondary-button-bg);
    border-color: var(--secondary-button-border);
}

.dark .btn-secondary:hover {
    background-color: var(--secondary-button-hover-bg);
}

/* 强制页面主体背景适配暗黑主题 */
.dark body {
    background-color: #000000 !important;
    color: #f5f5f5 !important;
}

/* 强制所有白色背景元素在暗黑主题下适配 */
.dark .bg-white {
    background-color: #262626 !important;
}

.dark .bg-gray-50 {
    background-color: #262626 !important;
}

.dark .bg-gray-100 {
    background-color: #262626 !important;
}

.dark .bg-gray-200 {
    background-color: #363636 !important;
}

.dark .bg-gray-300 {
    background-color: #363636 !important;
}

.dark .bg-gray-400 {
    background-color: #363636 !important;
}

.dark .bg-gray-500 {
    background-color: #363636 !important;
}

.dark .bg-gray-600 {
    background-color: #363636 !important;
}

.dark .bg-gray-700 {
    background-color: #262626 !important;
}

.dark .bg-gray-800 {
    background-color: #000000 !important;
}

.dark .bg-gray-900 {
    background-color: #000000 !important;
}

/* 强制模态窗口背景适配 */
.dark .modal-content {
    background-color: #262626 !important;
    color: #f5f5f5 !important;
    border-color: #363636 !important;
}

.dark .modal-content .bg-white {
    background-color: #262626 !important;
}

.dark .modal-content .bg-gray-100 {
    background-color: #262626 !important;
}

.dark .modal-content .bg-gray-50 {
    background-color: #262626 !important;
}

/* 强制所有文字颜色在暗黑主题下清晰可�?*/
.dark .text-gray-900 {
    color: #f9fafb !important;
}

.dark .text-gray-800 {
    color: #f3f4f6 !important;
}

.dark .text-gray-700 {
    color: #e5e7eb !important;
}

.dark .text-gray-600 {
    color: #d1d5db !important;
}

.dark .text-gray-500 {
    color: #9ca3af !important;
}

.dark .text-gray-400 {
    color: #a8a8a8 !important;
}

.dark .text-gray-300 {
    color: #9ca3af !important;
}

/* 强制所有边框颜色在暗黑主题下适配 */
.dark .border-gray-200 {
    border-color: #363636 !important;
}

.dark .border-gray-300 {
    border-color: #363636 !important;
}

.dark .border-gray-400 {
    border-color: #363636 !important;
}

/* 强制输入框和表单元素在暗黑主题下适配 */
.dark input,
.dark textarea,
.dark select {
    background-color: #262626 !important;
    color: #f5f5f5 !important;
    border-color: #363636 !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #a8a8a8 !important;
}

/* 强制头部区域在暗黑主题下适配 */
.dark header {
    background-color: #262626 !important;
    color: #f5f5f5 !important;
}

/* 强制所有卡片背景在暗黑主题下适配 */
.dark .rounded-lg {
    background-color: inherit;
}

.dark .shadow-md,
.dark .shadow-lg,
.dark .shadow-xl,
.dark .shadow-2xl {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

/* 强制图标背景在暗黑主题下使用更深的颜�?*/
.dark .bg-blue-100 {
    background-color: #262626 !important;
}

.dark .bg-blue-700 {
    background-color: #262626 !important;
}

.dark .bg-blue-900 {
    background-color: #262626 !important;
}

.dark .bg-purple-100 {
    background-color: #262626 !important;
}

.dark .bg-purple-700 {
    background-color: #262626 !important;
}

.dark .bg-purple-900 {
    background-color: #262626 !important;
}

.dark .bg-pink-100 {
    background-color: #262626 !important;
}

.dark .bg-pink-700 {
    background-color: #262626 !important;
}

.dark .bg-pink-900 {
    background-color: #262626 !important;
}

.dark .bg-green-100 {
    background-color: #262626 !important;
}

.dark .bg-green-700 {
    background-color: #262626 !important;
}

.dark .bg-green-900 {
    background-color: #262626 !important;
}

.dark .bg-yellow-100 {
    background-color: #262626 !important;
}

.dark .bg-yellow-700 {
    background-color: #262626 !important;
}

.dark .bg-yellow-900 {
    background-color: #262626 !important;
}

.dark .bg-red-100 {
    background-color: #262626 !important;
}

.dark .bg-red-700 {
    background-color: #262626 !important;
}

.dark .bg-red-900 {
    background-color: #262626 !important;
}

.dark .bg-indigo-100 {
    background-color: #262626 !important;
}

.dark .bg-indigo-700 {
    background-color: #262626 !important;
}

.dark .bg-indigo-900 {
    background-color: #262626 !important;
}

.dark .bg-teal-100 {
    background-color: #262626 !important;
}

.dark .bg-teal-700 {
    background-color: #262626 !important;
}

.dark .bg-teal-900 {
    background-color: #262626 !important;
}

.dark .bg-orange-100 {
    background-color: #262626 !important;
}

.dark .bg-orange-700 {
    background-color: #262626 !important;
}

.dark .bg-orange-900 {
    background-color: #262626 !important;
}

.dark .bg-cyan-100 {
    background-color: #262626 !important;
}

.dark .bg-cyan-700 {
    background-color: #262626 !important;
}

.dark .bg-cyan-900 {
    background-color: #262626 !important;
}

.dark .bg-lime-100 {
    background-color: #262626 !important;
}

.dark .bg-lime-700 {
    background-color: #262626 !important;
}

.dark .bg-lime-900 {
    background-color: #262626 !important;
}

.dark .bg-emerald-100 {
    background-color: #262626 !important;
}

.dark .bg-emerald-700 {
    background-color: #262626 !important;
}

.dark .bg-emerald-900 {
    background-color: #262626 !important;
}

/* 强制图标文字颜色在暗黑主题下清晰可见 - 使用高饱和度颜色 */
.dark .text-blue-500 {
    color: #3b82f6 !important;
}

.dark .text-blue-700 {
    color: #2563eb !important;
}

.dark .text-blue-800 {
    color: #5885ff !important;
}

.dark .text-purple-500 {
    color: #8b5cf6 !important;
}

.dark .text-purple-700 {
    color: #7c3aed !important;
}

.dark .text-purple-800 {
    color: #9b5aff !important;
}

.dark .text-pink-500 {
    color: #ec4899 !important;
}

.dark .text-pink-700 {
    color: #db2777 !important;
}

.dark .text-pink-800 {
    color: #be185d !important;
}

.dark .text-green-500 {
    color: #22c55e !important;
}

.dark .text-green-700 {
    color: #16a34a !important;
}

.dark .text-green-800 {
    color: #15803d !important;
}

.dark .text-yellow-500 {
    color: #eab308 !important;
}

.dark .text-yellow-700 {
    color: #ca8a04 !important;
}

.dark .text-yellow-800 {
    color: #a16207 !important;
}

.dark .text-red-500 {
    color: #ef4444 !important;
}

.dark .text-red-700 {
    color: #dc2626 !important;
}

.dark .text-red-800 {
    color: #b91c1c !important;
}

.dark .text-indigo-500 {
    color: #6366f1 !important;
}

.dark .text-indigo-700 {
    color: #4f46e5 !important;
}

.dark .text-indigo-800 {
    color: #4338ca !important;
}

.dark .text-teal-500 {
    color: #14b8a6 !important;
}

.dark .text-teal-700 {
    color: #0f766e !important;
}

.dark .text-teal-800 {
    color: #115e59 !important;
}

.dark .text-orange-500 {
    color: #f97316 !important;
}

.dark .text-orange-700 {
    color: #ea580c !important;
}

.dark .text-orange-800 {
    color: #c2410c !important;
}

.dark .text-cyan-500 {
    color: #06b6d4 !important;
}

.dark .text-cyan-700 {
    color: #0891b2 !important;
}

.dark .text-cyan-800 {
    color: #0e7490 !important;
}

.dark .text-lime-500 {
    color: #84cc16 !important;
}

.dark .text-lime-700 {
    color: #65a30d !important;
}

.dark .text-lime-800 {
    color: #4d7c0f !important;
}

.dark .text-emerald-500 {
    color: #10b981 !important;
}

.dark .text-emerald-700 {
    color: #059669 !important;
}

.dark .text-emerald-800 {
    color: #047857 !important;
}

/* 强制悬停状态的图标背景在暗黑主题下也使用深�?*/
.dark .hover\\:bg-blue-200:hover {
    background-color: #1e40af !important;
}

.dark .hover\\:bg-purple-200:hover {
    background-color: #7c3aed !important;
}

.dark .hover\\:bg-pink-200:hover {
    background-color: #be185d !important;
}

.dark .hover\\:bg-green-200:hover {
    background-color: #166534 !important;
}

.dark .hover\\:bg-yellow-200:hover {
    background-color: #a16207 !important;
}

.dark .hover\\:bg-red-200:hover {
    background-color: #991b1b !important;
}

.dark .hover\\:bg-gray-200:hover {
    background-color: #363636 !important;
}

/* 强制圆形图标容器在暗黑主题下使用深色背景 */
.dark .rounded-full {
    background-color: inherit;
}

/* 确保所有图标容器都有正确的对比�?*/
.dark .w-8.h-8.rounded-full {
    background-color: inherit !important;
}

/* 强制按钮状态的图标背景适配 */


/* Tag button gradients for dark mode */
.dark .bg-gradient-to-r.from-blue-50.to-cyan-50 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #374151;
    --tw-gradient-to: #1f2937;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-r.from-blue-50.to-cyan-50:hover {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #4B5563;
    --tw-gradient-to: #374151;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* Handle dark:from-gray-600 dark:to-gray-700 combination */
.dark .from-gray-600.to-gray-700 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #4B5563;
    --tw-gradient-to: #374151;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* Handle dark hover states */
.dark .hover\:from-gray-500.hover\:to-gray-600:hover {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #6B7280;
    --tw-gradient-to: #4B5563;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* Dark mode gradient backgrounds - Additional patterns */
.dark .bg-gradient-to-r.from-purple-100.to-blue-100 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #312e81;
    --tw-gradient-to: #1e3a8a;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-r.from-red-50.to-orange-50 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #7f1d1d;
    --tw-gradient-to: #9a3412;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-r.from-yellow-50.to-amber-50 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #854d0e;
    --tw-gradient-to: #92400e;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-blue-900\/20.to-purple-900\/20 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(30, 58, 138, 0.3);
    --tw-gradient-to: rgba(88, 28, 135, 0.3);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-pink-100.to-red-100 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(219, 39, 119, 0.3);
    --tw-gradient-to: rgba(185, 28, 28, 0.3);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-blue-100.to-cyan-100 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(29, 78, 216, 0.3);
    --tw-gradient-to: rgba(8, 145, 178, 0.3);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-green-100.to-emerald-100 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(22, 163, 74, 0.3);
    --tw-gradient-to: rgba(5, 150, 105, 0.3);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-yellow-100.to-orange-100 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(234, 179, 8, 0.3);
    --tw-gradient-to: rgba(234, 88, 12, 0.3);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-r.from-purple-100.to-pink-100 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(147, 51, 234, 0.3);
    --tw-gradient-to: rgba(236, 72, 153, 0.3);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-gray-100.to-gray-200 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: #4B5563;
    --tw-gradient-to: #374151;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-gray-50.via-blue-50\/30.to-purple-50\/30 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: #374151;
    --tw-gradient-via: rgba(30, 58, 138, 0.3);
    --tw-gradient-to: rgba(88, 28, 135, 0.3);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to);
}

/* Hover states for gradients */
.dark .hover\:from-blue-100.hover\:to-cyan-100:hover {
    --tw-gradient-from: rgba(29, 78, 216, 0.4);
    --tw-gradient-to: rgba(8, 145, 178, 0.4);
}

.dark .hover\:from-gray-500.hover\:to-gray-600:hover {
    --tw-gradient-from: #6B7280;
    --tw-gradient-to: #4B5563;
}

.dark .from-purple-500 {
    --tw-gradient-from: #7c3aed !important;
}

.dark .to-pink-500 {
    --tw-gradient-to: #ec4899 !important;
}

.dark .from-green-400 {
    --tw-gradient-from: #22c55e !important;
}

.dark .to-blue-500 {
    --tw-gradient-to: #3b82f6 !important;
}

/* 表单标签在暗黑主题下的适配 */
.dark .form-group label {
    color: #f3f4f6 !important;
}

.dark .form-group input[type="text"],
.dark .form-group input[type="email"],
.dark .form-group input[type="password"],
.dark .form-group input[type="number"],
.dark .form-group select,
.dark .form-group textarea {
    background-color: #262626 !important;
    color: #f3f4f6 !important;
    border-color: #363636 !important;
}

.dark .form-group input[type="text"]:focus,
.dark .form-group input[type="email"]:focus,
.dark .form-group input[type="password"]:focus,
.dark .form-group input[type="number"]:focus,
.dark .form-group select:focus,
.dark .form-group textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6 !important;
}

/* 打字动画 */
.typing-animation {
    display: flex;
    gap: 4px;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing-animation span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-animation span:nth-child(3) {
    animation-delay: 0.4s;
}

/* 表单样式 */
.form-checkbox {
    @apply rounded border-gray-300 text-blue-500 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50;
}

.dark .form-checkbox {
    @apply border-gray-600 bg-gray-700;
}

/* 头像动画 */
.avatar-pulse {
    position: relative;
}

.avatar-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    animation: pulse 2s infinite;
}

/* 衣柜项目样式 */
.wardrobe-item {
    transition: all 0.3s ease;
}

.wardrobe-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 深色模式下衣柜物品卡片优化 */
.dark .item-card {
    background-color: rgba(71, 71, 71, 0.8) !important; /* 使用更温和的深灰色 */
    border-color: rgba(95, 95, 95, 0.5) !important;
}

.dark .item-card:hover {
    background-color: rgba(94, 94, 94, 0.9) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-2px) !important; /* 更温和的悬停效果 */
}

/* 深色模式下衣物卡片文字清晰度优化 */
.dark .item-card h3 {
    color: #f9fafb !important; /* 标题使用更亮的白色 */
}

.dark .item-card p {
    color: #d8d8d8 !important; /* 描述文字使用更亮的灰色 */
}

/* 深色模式下稀有度标签优化 */
.dark .item-card .absolute .bg-green-500 {
    background-color: rgb(34, 197, 94) !important; /* 确保"已拥有"标签清晰 */
}

/* 深色模式下收藏按钮优化 */
.dark .item-card .favorite-btn {
    background-color: rgba(49, 49, 49, 0.8) !important;
    color: #e7e7e7 !important;
    border: 1px solid rgba(97, 97, 97, 0.5) !important;
}

.dark .item-card .favorite-btn:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

/* 深色模式下价格文字优化 */
.dark .item-card .text-yellow-600 {
    color: #fbbf24 !important; /* 价格使用更亮的黄色 */
}

/* 深色模式下按钮优化 */
.dark .item-card .purchase-btn,
.dark .item-card .generate-btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* 深色模式下图片占位符优化 */
.dark .item-fallback {
    background: linear-gradient(to bottom right, rgba(82, 82, 82, 0.8), rgba(92, 92, 92, 0.8)) !important;
    border: 1px solid rgba(75, 85, 99, 0.3) !important;
}

.dark .item-fallback .text-gray-400 {
    color: #afafaf !important;
}

.dark .item-fallback .text-gray-700 {
    color: #f3f4f6 !important;
}

.dark .item-fallback .text-gray-600 {
    color: #dadada !important;
}

/* 深色模式下衣柜分类筛选器优化 */
.dark .category-filter {
    background-color: rgba(88, 88, 88, 0.6) !important;
    color: #e7e7e7 !important;
    border: 1px solid rgba(100, 100, 100, 0.3) !important;
}

.dark .category-filter:hover {
    background-color: rgba(90, 90, 90, 0.8) !important;
    color: #f9fafb !important;
}

.dark .category-filter.bg-blue-50 {
    background-color: rgba(126, 126, 126, 0.3) !important;
    color: #f3f4f6 !important;
    border-color: rgba(161, 161, 161, 0.4) !important;
}

/* 深色模式下衣柜标签页优化 */
.dark .wardrobe-tab {
    background-color: rgba(78, 78, 78, 0.6) !important;
    color: #dadada !important;
    border-bottom: 2px solid transparent !important;
}

.dark .wardrobe-tab:hover {
    background-color: rgba(100, 100, 100, 0.8) !important;
    color: #f9fafb !important;
}

.dark .wardrobe-tab.border-blue-500 {
    background-color: rgba(129, 129, 129, 0.2) !important;
    color: #f9fafb !important;
    border-bottom-color: #d4d4d4 !important;
}

/* 深色模式下衣柜搜索框和筛选器优化 */
.dark #wardrobe-search {
    background-color: rgba(58, 58, 58, 0.8) !important;
    color: #f9fafb !important;
    border-color: rgba(95, 95, 95, 0.5) !important;
}

.dark #wardrobe-search::placeholder {
    color: #a7a7a7 !important;
}

.dark #wardrobe-search:focus {
    background-color: rgb(41, 41, 41) !important;
    border-color: #d3d3d3 !important;
    box-shadow: 0 0 0 2px rgba(182, 182, 182, 0.2) !important;
}

/* 深色模式下衣柜价格筛选器优化 */
.dark #min-price-filter,
.dark #max-price-filter,
.dark #rarity-filter,
.dark #sort-filter {
    background-color: rgba(48, 48, 48, 0.8) !important;
    color: #f9fafb !important;
    border-color: rgba(100, 100, 100, 0.5) !important;
}

.dark #min-price-filter:focus,
.dark #max-price-filter:focus,
.dark #rarity-filter:focus,
.dark #sort-filter:focus {
    background-color: rgb(63, 63, 63) !important;
    border-color: #d1d5db !important;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2) !important;
}

/* 深色模式下衣柜边栏背景优化 */
.dark .w-64.bg-gray-50 {
    background-color: rgba(53, 53, 53, 0.8) !important;
}

/* 深色模式下衣柜主内容区背景优化 */
.dark .flex-1.bg-gray-50 {
    background-color: rgba(32, 32, 32, 0.5) !important;
}

/* 深色模式下空状态显示优化 */
.dark .bg-blue-100,
.dark .bg-gray-100 {
    background-color: rgba(78, 78, 78, 0.6) !important;
}

.dark .text-gray-500 {
    color: #d1d5db !important;
}

/* 深色模式下衣柜模态窗口优化 */
.dark #wardrobe-modal .modal-content {
    background-color: rgba(39, 39, 39, 0.95) !important;
    border: 1px solid rgba(97, 97, 97, 0.3) !important;
}

/* 深色模式下衣柜关闭按钮优化 */
.dark #close-wardrobe {
    color: #d1d5db !important;
    background-color: rgba(80, 80, 80, 0.6) !important;
    border: 1px solid rgba(104, 104, 104, 0.3) !important;
}

.dark #close-wardrobe:hover {
    color: #f9fafb !important;
    background-color: rgba(94, 94, 94, 0.8) !important;
    border-color: rgba(121, 121, 121, 0.5) !important;
}

/* 深色模式下衣柜标题栏优化 */
.dark .border-gray-200 {
    border-color: rgba(94, 94, 94, 0.3) !important;
}

.dark .border-gray-700 {
    border-color: rgba(99, 99, 99, 0.5) !important;
}

/* 深色模式下金币余额显示优化 */
.dark .text-yellow-600,
.dark .text-yellow-500 {
    color: #fbbf24 !important;
}

/* 深色模式下分页器优化 */
.dark .pagination button {
    background-color: rgba(83, 83, 83, 0.8) !important;
    color: #dadada !important;
    border: 1px solid rgba(99, 99, 99, 0.3) !important;
}

.dark .pagination button:hover {
    background-color: rgba(97, 97, 97, 0.9) !important;
    color: #f9fafb !important;
}

.dark .pagination button.active {
    background-color: rgba(121, 121, 121, 0.9) !important;
    color: #ffffff !important;
    border-color: #d1d5db !important;
}

/* 标签页内容样�?*/
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 伴侣项目样式 */
.gf-item {
    position: relative;
    transition: all 0.2s ease;
}

.gf-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: translateX(2px);
}

.gf-item.selected {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid rgb(59, 130, 246);
}

/* 清除聊天记录按钮样式 */
.clear-chat-btn {
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.gf-item:hover .clear-chat-btn {
    opacity: 1;
}

.clear-chat-btn:hover {
    color: #ef4444; /* 红色 */
}

.dark .clear-chat-btn:hover {
    color: #f87171; /* 深色模式下的红色 */
}

/* 模态框样式 */
.modal {
    transition: opacity 0.3s ease-in-out;
    visibility: hidden;
    display: none;
}

.modal.opacity-100 {
    visibility: visible;
    display: flex !important;
}

.modal-content {
    transition: all 0.3s ease-in-out;
    transform: scale(0.95);
    opacity: 0;
}

.modal.opacity-100 .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* 确保模态窗口在最上层 */
.modal {
    z-index: 50;
}

/* 确保模态内容在背景之上 */
.modal .modal-content {
    z-index: 51;
    position: relative;
}

/* 图片查看模态窗口特殊样�?*/
#image-view-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

#image-view-modal .modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 0 0 0;
}

#image-view-modal .modal-content .absolute {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

#image-view-modal .modal-content img {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    border-radius: 0.5rem;
    cursor: move;
    transform-origin: center;
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

#image-view-modal .modal-content img:hover {
    cursor: move;
}

#image-view-modal .modal-content img.zoomed {
    cursor: zoom-out;
}

#image-view-modal .modal-content #image-params {
    margin-top: 1rem;
    color: var(--text-color);
    font-size: 0.875rem;
    background-color: var(--modal-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 100px;
    overflow-y: auto;
    width: 100%;
}

/* 自定义滚动条样式 */
#image-view-modal .modal-content #image-params::-webkit-scrollbar {
    width: 6px;
}

#image-view-modal .modal-content #image-params::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

#image-view-modal .modal-content #image-params::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg);
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

#image-view-modal .modal-content #image-params::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-bg);
}

#image-view-modal #save-to-memory-btn,
#image-view-modal #share-image-btn,
#image-view-modal .close-modal,
#image-view-modal button {
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 0.875rem;
}

#image-view-modal #save-to-memory-btn,
#image-view-modal #share-image-btn,
#image-view-modal button:not(.close-modal) {
    background-color: var(--primary-button-bg);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease-in-out;
}

#image-view-modal #save-to-memory-btn:hover,
#image-view-modal #share-image-btn:hover,
#image-view-modal button:not(.close-modal):hover {
    background-color: var(--primary-button-hover-bg);
}

#image-view-modal .close-modal {
    background-color: var(--button-bg);
    color: var(--text-color);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

#image-view-modal .close-modal:hover {
    background-color: var(--button-hover-bg);
}

/* 移动端适配 */
@media (max-width: 640px) {
    #image-view-modal .modal-content {
        padding: 4rem 0.5rem 0 0.5rem;
    }

    #image-view-modal .modal-content .absolute {
        top: 0.25rem;
        right: 0.25rem;
    }

    #image-view-modal #save-to-memory-btn,
    #image-view-modal #share-image-btn,
    #image-view-modal button:not(.close-modal) {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    #image-view-modal .close-modal {
        width: 2rem;
        height: 2rem;
    }

    #image-view-modal .modal-content img {
        max-height: calc(90vh - 140px);
    }
}

/* 菜单项样�?*/
.menu-item {
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.menu-item.active {
    background-color: rgba(59, 130, 246, 0.2);
    border-left: 3px solid rgb(59, 130, 246);
}

/* 主内容区域布局 - 基础样式 */
.flex-1.flex.flex-col {
    margin: 0 auto;
    transition: all 0.3s ease;
    position: relative;
    max-width: 800px;
    width: 100%;
}

/* 头部扩展区域样式 */
#header-expanded-content {
    overflow-y: auto;
    position: relative;
    z-index: 50;
    background-color: var(--bg-color);
    max-height: 60vh; /* 限制最大高度为屏幕的60% */
    border-radius: 0.5rem;
}

/* 图片预览区域样式 */
#gallery-thumbnails {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#gallery-thumbnails::-webkit-scrollbar {
    width: 6px;
}

#gallery-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

#gallery-thumbnails::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

/* 图片展示区域布局 */
#header-expanded-content .flex.gap-4 {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    height: min(300px, 40vh); /* 最大300px或40vh */
    min-height: 200px;
}

/* 主图区域 */
#header-expanded-content .flex-1 .aspect-w-16 {
    height: 100%;
    position: relative;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
}

#header-expanded-content .flex-1 .aspect-w-16 img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

/* 缩略图区域 */
#header-expanded-content .w-32 {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#header-expanded-content .thumbnail-item {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
    height: 60px;
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#header-expanded-content .thumbnail-item:hover {
    transform: scale(1.05);
}

#header-expanded-content .thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 深色模式下的扩展区域优化 */
.dark #header-expanded-content {
    background-color: #000000;
    border: 1px solid #363636;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 0.5rem 0;
}
.dark #header-expanded-content .flex-1 .aspect-w-16 {
    background-color: rgba(38, 38, 38, 0.05);
}

/* 宽屏模式下的响应式优化 */
@media (min-width: 1024px) {
    #header-expanded-content {
        max-height: 50vh;
    }
    #header-expanded-content .flex.gap-4 {
        height: min(280px, 35vh);
    }
}

@media (min-width: 1440px) {
    #header-expanded-content {
        max-height: 45vh;
    }
    #header-expanded-content .flex.gap-4 {
        height: min(260px, 30vh);
    }
}

/* 侧栏基础样式 */
aside.md\:w-64,
aside.md\:w-48 {
    position: fixed;
    height: calc(100vh - 96px);
    width: 280px;
    z-index: 30;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 左侧栏定位和动画 */
aside.md\:w-64 {
    left: 0;
    transform: translateX(-100%);
}

aside.md\:w-64:not(.sidebar-collapsed) {
    transform: translateX(0);
}

/* 右侧栏定位和动画 */
aside.md\:w-48 {
    right: 0;
    transform: translateX(100%);
}

aside.md\:w-48:not(.sidebar-collapsed) {
    transform: translateX(0);
}

/* 侧栏切换按钮样式 */
.sidebar-toggle {
    position: fixed !important;
    width: 24px !important;
    height: 48px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 40 !important;
    background: var(--bg-color) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 左侧栏按�?*/
.left-sidebar-toggle {
    left: 280px !important;
    border-radius: 0 8px 8px 0 !important;
}

/* 右侧栏按�?*/
.right-sidebar-toggle {
    right: 280px !important;
    border-radius: 8px 0 0 8px !important;
}

/* 侧栏折叠状态下的按钮位�?*/
aside.md\:w-64.sidebar-collapsed ~ .left-sidebar-toggle {
    left: 0 !important;
}

aside.md\:w-48.sidebar-collapsed ~ .right-sidebar-toggle {
    right: 0 !important;
}

/* 侧栏折叠状态下的按钮图标旋�?*/
aside.md\:w-64.sidebar-collapsed ~ .left-sidebar-toggle i {
    transform: rotate(180deg);
}

aside.md\:w-48.sidebar-collapsed ~ .right-sidebar-toggle i {
    transform: rotate(180deg);
}

/* 侧栏内容样式 */
.sidebar-content {
    height: 100%;
    opacity: 1;
    transition: opacity 0.3s ease;
    background-color: var(--bg-color);
    padding: 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
}

/* 侧栏折叠状态下的内容隐�?*/
.sidebar-collapsed .sidebar-content {
    opacity: 0;
    visibility: hidden;
}

/* 深色模式适配 */
.dark aside {
    --bg-color: rgb(43, 43, 43);
    border-color: rgba(38, 38, 38, 0.1);
}

/* 亮色模式适配 */
aside {
    --bg-color: rgb(255, 255, 255);
    border-color: rgba(0, 0, 0, 0.1);
}

/* 过渡效果 */
.transition-all {
    transition: all 0.3s ease-in-out;
}

/* 消息窗口滚动条样�?*/
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* 暗黑主题下的聊天消息滚动条样�?*/
.dark #chat-messages::-webkit-scrollbar-thumb {
    background: rgba(54, 54, 54, 0.5);
}

.dark #chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(54, 54, 54, 0.8);
}

/* 侧边栏折叠样�?*/
.sidebar-collapsed {
    width: 60px !important;
}

.sidebar-collapsed .sidebar-content {
    display: none;
}

.sidebar-collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

/* 模态窗口样�?*/
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.8);
}

/* 暗黑主题下的自定义滚动条样式 */
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(54, 54, 54, 0.5);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(54, 54, 54, 0.8);
}

/* 用户资料模态窗口滚动条样式 */
#user-profile-modal .scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

#user-profile-modal .scrollbar-thin::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#user-profile-modal .scrollbar-thin::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

#user-profile-modal .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 深色模式下的用户资料模态窗口滚动条样式 */
.dark #user-profile-modal .scrollbar-thin::-webkit-scrollbar-track {
    background: #262626;
}

.dark #user-profile-modal .scrollbar-thin::-webkit-scrollbar-thumb {
    background: #363636;
}

.dark #user-profile-modal .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #404040;
}

/* Container Heights */
#main-container {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

main {
    width: 54%;
    height: calc(100vh - 64px);
    overflow: hidden;
    margin-top: 64px;
}

#chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Required for Firefox */
}

/* 错误提示样式 */
.error-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    animation: fadeInOut 3s ease;
}

.error-toast.error {
    background-color: #ef4444;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    10% { opacity: 1; transform: translate(-50%, 0); }
    90% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* 新的系统通知样式 */
.system-notification {
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.system-notification:hover {
    transform: translateX(-4px) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 中央悬浮通知样式 */
.center-notification {
    z-index: 9999;
}

.center-notification > div {
    backdrop-filter: blur(16px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(38, 38, 38, 0.1),
        inset 0 1px 0 rgba(38, 38, 38, 0.1);
}

.center-notification:hover > div {
    transform: translateX(-50%) translateY(0) scale(1.02) !important;
    box-shadow: 
        0 32px 64px -12px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(38, 38, 38, 0.15),
        inset 0 1px 0 rgba(38, 38, 38, 0.15);
}

/* 不同类型通知的特殊效�?*/
.center-notification .bg-red-500 {
    animation: pulse-error 2s infinite;
}

.center-notification .bg-green-500 {
    animation: pulse-success 1.5s ease-in-out;
}

.center-notification .bg-yellow-500 {
    animation: wobble-warning 0.8s ease-in-out;
}

@keyframes pulse-error {
    0%, 100% { box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.25), 0 0 0 1px rgba(38, 38, 38, 0.1), inset 0 1px 0 rgba(38, 38, 38, 0.1); }
    50% { box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.4), 0 0 20px rgba(239, 68, 68, 0.3), 0 0 0 1px rgba(38, 38, 38, 0.15), inset 0 1px 0 rgba(38, 38, 38, 0.15); }
}

@keyframes pulse-success {
    0% { transform: translateX(-50%) translateY(0) scale(0.95); opacity: 0; }
    50% { transform: translateX(-50%) translateY(0) scale(1.05); }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

@keyframes wobble-warning {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
    25% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
    75% { transform: translateX(-50%) translateY(0) rotate(2deg); }
}

.notification-progress {
    width: 100%;
    transition-property: width;
}

.notification-close-btn {
    opacity: 0.7;
}

.notification-close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .system-notification {
        backdrop-filter: blur(12px);
    }
    
    .center-notification > div {
        backdrop-filter: blur(20px);
        box-shadow: 
            0 25px 50px -12px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(38, 38, 38, 0.1),
            inset 0 1px 0 rgba(38, 38, 38, 0.1);
    }
}

/* 响应式适配 */
@media (max-width: 640px) {
    .system-notification {
        top: 1rem !important;
        right: 1rem !important;
        left: 1rem !important;
        max-width: none !important;
        width: auto !important;
    }
    
    .center-notification > div {
        bottom: 8rem !important;
        left: 1rem !important;
        right: 1rem !important;
        transform: none !important;
        max-width: none !important;
        min-width: auto !important;
        width: auto !important;
    }
    
    .center-notification:hover > div {
        transform: none !important;
    }
}

/* 平板适配 */
@media (max-width: 768px) and (min-width: 641px) {
    .center-notification > div {
        max-width: 20rem;
        min-width: 18rem;
    }
}

/* 暗色模式适配 */
/* 媒体查询中的暗黑主题样式已移动到 .dark 类中，以便手动主题切�?*/

/* 图片消息样式 */
.chat-message-image {
    background-color: transparent !important;
    padding: 0.5rem !important;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background-color: rgba(38, 38, 38, 0.05);
    transition: transform 0.2s ease-in-out;
}

.image-container:hover {
    transform: scale(1.02);
}

.generated-image {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 0.5rem;
}

.image-params {
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #a8a8a8;
    background-color: rgba(38, 38, 38, 0.1);
    border-top: 1px solid rgba(38, 38, 38, 0.1);
    white-space: pre-wrap;
}

/* 暗色模式适配 */
.dark .image-container {
    background-color: rgba(0, 0, 0, 0.2);
}

.dark .image-params {
    color: #9CA3AF;
    background-color: rgba(0, 0, 0, 0.2);
    border-top-color: rgba(38, 38, 38, 0.05);
}

/* 加载中动�?*/
.chat-message-system {
    color: #3B82F6;
    font-style: italic;
}

/* 错误消息样式 */
.chat-message-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    font-style: italic;
}

/* 侧栏展开/收起动画 */
aside.md\:w-64,
aside.md\:w-48 {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧栏悬停效果 */
aside.md\:w-64:hover,
aside.md\:w-48:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 侧栏折叠状态下的按钮位�?*/
.sidebar-collapsed .left-sidebar-toggle {
    left: 0 !important;
}

.sidebar-collapsed .right-sidebar-toggle {
    right: 0 !important;
}

/* 系统消息开关样�?*/
.toggle-container {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
}

.toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 1.5rem;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 1.25rem;
    width: 1.25rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #3B82F6;
}

.toggle-checkbox:checked + .toggle-label:before {
    transform: translateX(1.5rem);
}

/* 暗色模式适配 */
.dark .toggle-label {
    background-color: #363636;
}

.dark .toggle-checkbox:checked + .toggle-label {
    background-color: #60A5FA;
}

/* AI Profile Edit Modal Styles */
.avatar-upload-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border: 2px dashed #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.tag {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
}

/* Dark mode styles */
.dark .tag {
    background: #363636;
    color: #e5e7eb;
}

.dark .tag button {
    color: #9ca3af;
}

.dark .avatar-preview {
    border-color: #363636;
}

/* Form group styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Input styles */
.form-group input[type="text"],
.form-group input[type="color"],
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
}

.dark .form-group input[type="text"],
.dark .form-group input[type="color"],
.dark .form-group select {
    background-color: #262626;
    border-color: #363636;
    color: #e5e7eb;
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #363636;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #404040;
}

/* 移除按钮的默认外�?*/
button {
    outline: none !important;
}
button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 聊天输入区域样式 */
.chat-input-container {
    position: sticky;
    bottom: 0;
    background: var(--bg-color);
    padding: 8px;
    border-top: 1px solid var(--border-color);
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* 暗黑主题下的聊天输入区域样式 */
.dark .chat-input-container {
    background-color: #262626;
    border-top-color: #363636;
}

.dark .chat-input-container input {
    background-color: #262626;
    border-color: #363636;
    color: #f5f5f5;
}

.dark .chat-input-container input::placeholder {
    color: #a8a8a8;
}

.dark .chat-input-container input:focus {
    ring-color: #363636;
    border-color: #363636;
}

.dark .chat-input-container button {
    color: #f5f5f5;
}

.dark .chat-input-container button:hover {
    background-color: #363636;
}

/* 宽屏模式下的输入区域样式 */
@media (min-width: 1024px) {
    .chat-input-container {
        max-width: 800px;
        margin: 0 24px;
        padding: 12px;
        border-radius: 0 0 8px 8px;
    }
}

/* 移动端隐藏左侧栏拉出按钮 */
@media (max-width: 767px) {
    .left-sidebar-toggle {
        display: none !important;
    }
}

/* Markdown渲染内容样式 */
#memory-detail-content h1,
#memory-detail-content h2,
#memory-detail-content h3,
#memory-detail-content h4,
#memory-detail-content h5,
#memory-detail-content h6 {
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

#memory-detail-content h1 {
    font-size: 1.875rem; /* 30px */
}

#memory-detail-content h2 {
    font-size: 1.5rem; /* 24px */
}

#memory-detail-content h3 {
    font-size: 1.25rem; /* 20px */
}

#memory-detail-content h4 {
    font-size: 1.125rem; /* 18px */
}

#memory-detail-content h5 {
    font-size: 1rem; /* 16px */
}

#memory-detail-content h6 {
    font-size: 0.875rem; /* 14px */
}

#memory-detail-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

#memory-detail-content strong {
    font-weight: bold;
}

#memory-detail-content em {
    font-style: italic;
}

#memory-detail-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
}

.dark #memory-detail-content code {
    background-color: #262626;
    color: #f5f5f5;
}

#memory-detail-content pre {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.dark #memory-detail-content pre {
    background-color: #262626;
}

#memory-detail-content pre code {
    background-color: transparent;
    padding: 0;
}

#memory-detail-content ul,
#memory-detail-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

#memory-detail-content ul li {
    list-style-type: disc;
    margin-bottom: 0.25rem;
}

#memory-detail-content ol li {
    list-style-type: decimal;
    margin-bottom: 0.25rem;
}

#memory-detail-content blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #a8a8a8;
}

.dark #memory-detail-content blockquote {
    border-left-color: #363636;
    color: #a8a8a8;
}

#memory-detail-content a {
    color: #3b82f6;
    text-decoration: underline;
}

#memory-detail-content a:hover {
    color: #1d4ed8;
}

.dark #memory-detail-content a {
    color: #60a5fa;
}

.dark #memory-detail-content a:hover {
    color: #93c5fd;
}

#memory-detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

#memory-detail-content table th,
#memory-detail-content table td {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    text-align: left;
}

#memory-detail-content table th {
    background-color: #f9fafb;
    font-weight: bold;
}

.dark #memory-detail-content table th,
.dark #memory-detail-content table td {
    border-color: #363636;
}

.dark #memory-detail-content table th {
    background-color: #262626;
}

#memory-detail-content hr {
    border: none;
    border-top: 1px solid #d1d5db;
    margin: 1.5rem 0;
}

.dark #memory-detail-content hr {
    border-top-color: #363636;
}

/* 聊天系统状态样�?*/
.chat-system-status {
    transition: all 0.3s ease-in-out;
}

.chat-system-status .animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 聊天系统状态的悬停效果 */
.chat-system-status:hover {
    transform: translateY(-2px);
}

/* 暗色模式下的聊天系统状�?*/
@media (prefers-color-scheme: dark) {
    .chat-system-status {
        backdrop-filter: blur(8px);
    }
}

/* 确保聊天系统状态不会被其他元素遮挡 */
.chat-system-status {
    z-index: 10;
    position: relative;
}

/* 🔒 副本任务系统样式 */

/* 普通模式样�?*/
.normal-mode .dungeon-ui {
    display: none;
}

/* 副本模式样式 */
.dungeon-mode .chat-container::before {
    content: '🎭 副本模式';
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: float 3s ease-in-out infinite;
}

/* 副本入口按钮样式 */
.dungeon-section {
    margin-top: 1rem;
}

.dungeon-section button {
    width: 100%;
    background: linear-gradient(45deg, #8b5cf6, #ec4899);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.dungeon-section button:hover {
    background: linear-gradient(45deg, #7c3aed, #db2777);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

/* 副本模态窗口样�?*/
#dungeon-modal {
    z-index: 9999;
}

#dungeon-modal .modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 主题卡片样式 */
.theme-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.theme-card:hover {
    background: #e2e8f0;
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.2);
}

/* 进度条样�?*/
.completion-bar {
    background: #e5e7eb;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.completion-progress {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* 场景图片样式 */
.scene-image-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.scene-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.scene-loading {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    color: #a8a8a8;
}

/* 场景切换通知样式 */
.scene-transition-notification {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #1e40af;
    animation: fadeIn 0.3s ease;
}

/* 关键词反馈样�?*/
.keyword-feedback {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #047857;
    animation: fadeIn 0.3s ease;
}

/* 副本信息面板样式 */
.dungeon-info-panel {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

/* 操作按钮样式 */
.dungeon-btn-primary {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dungeon-btn-primary:hover {
    background: linear-gradient(45deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.dungeon-btn-secondary {
    background: #a8a8a8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dungeon-btn-secondary:hover {
    background: #363636;
    transform: translateY(-1px);
}

/* 深色模式适配 */
.dark #dungeon-modal .modal-content {
    background: #000000;
    color: white;
}

.dark .theme-card {
    background: #262626;
    color: white;
}

.dark .theme-card:hover {
    background: #363636;
    border-color: #8b5cf6;
}

.dark .dungeon-info-panel {
    background: #262626;
    border-color: #363636;
    color: white;
}

.dark .scene-loading {
    background: #262626;
    color: #9ca3af;
}

/* 响应式设�?*/
@media (max-width: 768px) {
    #dungeon-modal .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .dungeon-mode .chat-container::before {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes dungeonFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-8px) rotate(1deg); }
    66% { transform: translateY(-4px) rotate(-1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.dungeon-float {
    animation: dungeonFloat 3s ease-in-out infinite;
}

/* 模式切换通知样式 */
.mode-switch-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

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

.system-message {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-in-out;
}

.system-message.info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.system-message.error {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.system-message.warning {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.connection-status.online {
    color: #2e7d32;
    background-color: #e8f5e9;
}

.connection-status.offline {
    color: #c62828;
    background-color: #ffebee;
}

.connection-status.reconnecting {
    color: #f57c00;
    background-color: #fff3e0;
}

.connection-status.error {
    color: #d32f2f;
    background-color: #ffebee;
}

.connection-status.failed {
    color: #c62828;
    background-color: #ffebee;
}

.reconnect-button {
    margin-left: 8px;
    transition: all 0.2s ease-in-out;
}

.reconnect-button:hover {
    transform: scale(1.05);
}

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

/* ========== 创建AI角色按钮特殊样式 ========== */
#add-gf-btn {
    position: relative;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
    padding: 10px !important;
    font-size: 16px !important;
    animation: glow 2s ease-in-out infinite, buttonPulse 3s ease-in-out infinite;
    transition: all 0.3s ease !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border: 2px solid rgba(38, 38, 38, 0.2) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

#add-gf-btn:hover {
    transform: scale(1.15) rotate(90deg) !important;
    background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
    animation: glow 0.8s ease-in-out infinite, buttonPulse 1s ease-in-out infinite;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5) !important;
}

#add-gf-btn i {
    font-size: 18px !important;
    font-weight: bold;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* 给创建按钮添加旋转彩色边框效�?*/
#add-gf-btn::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #ff006e, #fb5607, #ffbe0b, #8338ec, #3a86ff, #ff006e);
    border-radius: inherit;
    z-index: -1;
    animation: borderRotate 4s linear infinite;
    opacity: 0.8;
    background-size: 400% 400%;
}

@keyframes borderRotate {
    0% {
        transform: rotate(0deg);
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        transform: rotate(360deg);
        background-position: 0% 50%;
    }
}

/* 创建按钮的父容器样式优化 */
.flex.gap-2 {
    position: relative;
    align-items: center;
}

/* 管理按钮相对低调一�?*/
#manage-gf-btn {
    opacity: 0.7 !important;
    transition: all 0.2s ease !important;
    background-color: #f3f4f6 !important;
}

#manage-gf-btn:hover {
    opacity: 1 !important;
    transform: scale(1.05) !important;
    background-color: #e5e7eb !important;
}

/* 深色模式下的管理按钮 */
.dark #manage-gf-btn {
    background-color: #262626 !important;
}

.dark #manage-gf-btn:hover {
    background-color: #363636 !important;
}

/* 添加一个小的提示文字（可选） */
#add-gf-btn::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* 响应式优�?*/
@media (max-width: 768px) {
    #add-gf-btn {
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 8px !important;
        font-size: 14px !important;
    }
    
    #add-gf-btn i {
        font-size: 16px !important;
    }
}

/* 资料卡片样式 */
.card-style-btn {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.card-style-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-style-btn.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px #3B82F6;
}

.card-style-btn.active::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    background: #3B82F6;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* 技术信息折叠动�?*/
#technical-info-content {
    transition: all 0.3s ease;
}

#technical-info-toggle.expanded #technical-info-icon {
    transform: rotate(180deg);
}

/* 资料卡片画布样式 */
#profile-card-canvas {
    transition: all 0.3s ease;
}

#profile-card-canvas:hover {
    transform: scale(1.02);
}

/* 分享按钮动画 */
.share-button-animation {
    animation: shareButtonPulse 0.6s ease-in-out;
}

@keyframes shareButtonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 统计数据卡片悬停效果 */
.stats-card {
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 统计数据卡片深色模式渐变背景修复 */
.dark .bg-gradient-to-br.from-pink-100.to-red-100 {
    background: linear-gradient(to bottom right, rgba(236, 72, 153, 0.3), rgba(239, 68, 68, 0.3)) !important;
}

.dark .bg-gradient-to-br.from-blue-100.to-cyan-100 {
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.3), rgba(6, 182, 212, 0.3)) !important;
}

.dark .bg-gradient-to-br.from-green-100.to-emerald-100 {
    background: linear-gradient(to bottom right, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.3)) !important;
}

.dark .bg-gradient-to-br.from-yellow-100.to-orange-100 {
    background: linear-gradient(to bottom right, rgba(234, 179, 8, 0.3), rgba(249, 115, 22, 0.3)) !important;
}

/* 统计数据卡片深色模式边框修复 */
.dark .border-pink-200 {
    border-color: rgb(219, 39, 119) !important;
}

.dark .border-blue-200 {
    border-color: rgb(29, 78, 216) !important;
}

.dark .border-green-200 {
    border-color: rgb(21, 128, 61) !important;
}

.dark .border-yellow-200 {
    border-color: rgb(180, 83, 9) !important;
}

/* 分享和生成卡片按钮区域深色模式修复 */
.dark .bg-gradient-to-r.from-purple-100.to-pink-100 {
    background: linear-gradient(to right, rgba(147, 51, 234, 0.9), rgba(236, 72, 153, 0.9)) !important;
}

.dark .border-purple-200 {
    border-color: rgb(126, 34, 206) !important;
}

/* 用户资料卡区域深色模式修复 */
.dark .bg-gradient-to-br.from-blue-900.to-purple-900 {
    background: linear-gradient(to bottom right, rgba(30, 58, 138, 0.3), rgba(88, 28, 135, 0.3)) !important;
}

.dark .border-purple-700 {
    border-color: rgb(109, 40, 217) !important;
}

/* 头像在线状态动�?*/
.online-indicator {
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 卡片生成加载状�?*/
.card-generating {
    position: relative;
    overflow: hidden;
}

.card-generating::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(38, 38, 38, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

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

/* 响应式设�?*/
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    #profile-card-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* 深色模式适配 */
.dark .card-style-btn.active {
    border-color: #262626;
    box-shadow: 0 0 0 2px #60A5FA;
}

.dark .card-style-btn.active::after {
    background: #60A5FA;
}

/* 特殊效果 */
.sparkle-effect {
    position: relative;
}

.sparkle-effect::before {
    content: "🎉";
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

/* 标签样式增强 */
.interest-tag, .personality-tag {
    transition: all 0.2s ease;
    cursor: pointer;
}

.interest-tag:hover, .personality-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 成功提示动画 */
.success-animation {
    animation: successBounce 0.6s ease-in-out;
}

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

/* 🆕 网络恢复对话框样�?*/
#network-recovery-dialog {
    z-index: 9999;
}

#network-recovery-dialog .bg-white {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(38, 38, 38, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(38, 38, 38, 0.2);
}

#network-recovery-dialog .bg-green-100 {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

#network-recovery-dialog button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.025em;
}

#network-recovery-dialog button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

#network-recovery-dialog .bg-blue-600:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

#network-recovery-dialog .bg-gray-600:hover {
    background: linear-gradient(135deg, #363636 0%, #262626 100%);
}

#network-recovery-dialog .bg-red-600:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* 网络恢复对话框动�?*/
#network-recovery-dialog .fixed {
    animation: networkRecoveryFadeIn 0.4s ease-out;
}

@keyframes networkRecoveryFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

/* 倒计时文字渐变效�?*/
#auto-continue-countdown {
    background: linear-gradient(90deg, #a8a8a8, #9ca3af, #a8a8a8);
    background-size: 200% 100%;
    animation: gradientShift 2s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 深色模式适配 */
.dark #network-recovery-dialog .bg-white {
    background: linear-gradient(135deg, #262626 0%, #000000 100%);
    border-color: rgba(54, 54, 54, 0.3);
}

.dark #network-recovery-dialog .bg-green-100 {
    background: linear-gradient(135deg, #262626 0%, #363636 100%);
}

.dark #network-recovery-dialog .text-gray-600 {
    color: #a8a8a8;
}

.dark #network-recovery-dialog .text-gray-500 {
    color: #a8a8a8;
}

/* 🆕 添加警告动画 */
@keyframes warningPulse {
    0% {
        transform: scale(1);
        opacity: 1;
        text-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
        text-shadow: 0 0 15px rgba(255, 107, 107, 0.8);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        text-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    }
}

/* ================================= */
/* Dark Mode Gradient Backgrounds */
/* ================================= */

/* Dark mode gradient backgrounds */
.dark .bg-gradient-to-br.from-gray-50.to-gray-100 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: #374151;
    --tw-gradient-to: #1f2937;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .bg-gradient-to-br.from-gray-700.to-gray-800 {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    --tw-gradient-from: #374151;
    --tw-gradient-to: #1f2937;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* ================================= */
/* Avatar Generator Interface Enhancements */
/* ================================= */

/* Enhanced Avatar Generator Modal */
.dark #avatar-generator-modal {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.dark #avatar-generator-modal .modal-content {
    background: linear-gradient(135deg, 
        rgba(17, 24, 39, 0.95) 0%, 
        rgba(31, 41, 55, 0.95) 50%, 
        rgba(17, 24, 39, 0.95) 100%);
    border: 2px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 
                0 0 100px rgba(59, 130, 246, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.dark #avatar-generator-modal .modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, 
        rgba(147, 51, 234, 0.05) 0%, 
        rgba(236, 72, 153, 0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
}

/* Enhanced Header */
.dark #avatar-generator-modal h3 {
    background: linear-gradient(135deg, #a855f7, #ec4899, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(168, 85, 247, 0.3));
    font-weight: 700;
    letter-spacing: 0.5px;
}

.dark #avatar-generator-modal #close-avatar-generator {
    color: #9ca3af;
    background: rgba(55, 65, 81, 0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.dark #avatar-generator-modal #close-avatar-generator:hover {
    color: #f3f4f6;
    background: rgba(75, 85, 99, 0.9);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Enhanced Preset Buttons Section */
.dark #avatar-generator-modal .bg-gradient-to-r.from-purple-900\/20 {
    background: linear-gradient(135deg, 
        rgba(88, 28, 135, 0.3) 0%, 
        rgba(162, 28, 175, 0.25) 50%,
        rgba(88, 28, 135, 0.3) 100%);
    border: 1px solid rgba(147, 51, 234, 0.2);
    box-shadow: 0 8px 32px rgba(147, 51, 234, 0.1);
    backdrop-filter: blur(10px);
}

.dark #avatar-generator-modal .preset-btn {
    background: linear-gradient(135deg, 
        rgba(55, 65, 81, 0.9) 0%, 
        rgba(75, 85, 99, 0.8) 100%);
    border: 2px solid rgba(107, 114, 128, 0.3);
    color: #f3f4f6;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    font-weight: 500;
}

.dark #avatar-generator-modal .preset-btn:hover {
    background: linear-gradient(135deg, 
        rgba(75, 85, 99, 1) 0%, 
        rgba(107, 114, 128, 0.9) 100%);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2), 
                0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark #avatar-generator-modal .preset-btn.active {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.8) 0%, 
        rgba(147, 51, 234, 0.8) 100%);
    border-color: rgba(59, 130, 246, 0.7);
    color: white;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Enhanced Form Sections */
.dark #avatar-generator-modal .bg-gray-50 {
    background: linear-gradient(135deg, 
        rgba(31, 41, 55, 0.8) 0%, 
        rgba(55, 65, 81, 0.6) 100%);
    border: 1px solid rgba(75, 85, 99, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.dark #avatar-generator-modal h4 {
    color: #f9fafb;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Enhanced Select and Input Elements */
.dark #avatar-generator-modal select,
.dark #avatar-generator-modal textarea {
    background: linear-gradient(135deg, 
        rgba(17, 24, 39, 0.9) 0%, 
        rgba(31, 41, 55, 0.8) 100%);
    border: 2px solid rgba(75, 85, 99, 0.5);
    color: #f3f4f6;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-weight: 500;
}

.dark #avatar-generator-modal select:focus,
.dark #avatar-generator-modal textarea:focus {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 
                0 4px 12px rgba(59, 130, 246, 0.1);
    outline: none;
    background: linear-gradient(135deg, 
        rgba(17, 24, 39, 1) 0%, 
        rgba(31, 41, 55, 0.9) 100%);
}

.dark #avatar-generator-modal select:hover,
.dark #avatar-generator-modal textarea:hover {
    border-color: rgba(107, 114, 128, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark #avatar-generator-modal textarea::placeholder {
    color: rgba(156, 163, 175, 0.8);
    font-style: italic;
}

/* Enhanced Regional Sliders */
.dark #avatar-generator-modal .regional-slider {
    height: 8px;
    background: linear-gradient(90deg, 
        rgba(55, 65, 81, 0.8) 0%, 
        rgba(75, 85, 99, 0.6) 100%);
    border-radius: 6px;
    outline: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.dark #avatar-generator-modal .regional-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, 
        #3b82f6 0%, 
        #8b5cf6 50%, 
        #ec4899 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 
                0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.dark #avatar-generator-modal .regional-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6), 
                0 3px 8px rgba(0, 0, 0, 0.4);
}

.dark #avatar-generator-modal .regional-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.8);
}

.dark #avatar-generator-modal .regional-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, 
        #3b82f6 0%, 
        #8b5cf6 50%, 
        #ec4899 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.dark #avatar-generator-modal .regional-slider-group label {
    color: #d1d5db;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dark #avatar-generator-modal .regional-slider-group span {
    color: #60a5fa;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Enhanced Reset Button */
.dark #avatar-generator-modal #reset-regional-sliders {
    background: linear-gradient(135deg, 
        rgba(75, 85, 99, 0.8) 0%, 
        rgba(107, 114, 128, 0.6) 100%);
    border: 2px solid rgba(107, 114, 128, 0.4);
    color: #d1d5db;
    transition: all 0.3s ease;
    font-weight: 500;
}

.dark #avatar-generator-modal #reset-regional-sliders:hover {
    background: linear-gradient(135deg, 
        rgba(107, 114, 128, 0.9) 0%, 
        rgba(75, 85, 99, 0.8) 100%);
    border-color: rgba(156, 163, 175, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Enhanced Generate Button */
.dark #avatar-generator-modal #generate-avatar-image {
    background: linear-gradient(135deg, 
        #8b5cf6 0%, 
        #ec4899 50%, 
        #f59e0b 100%);
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4), 
                0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dark #avatar-generator-modal #generate-avatar-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.dark #avatar-generator-modal #generate-avatar-image:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.5), 
                0 6px 20px rgba(0, 0, 0, 0.4);
}

.dark #avatar-generator-modal #generate-avatar-image:hover::before {
    left: 100%;
}

.dark #avatar-generator-modal #generate-avatar-image:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.dark #avatar-generator-modal #generate-avatar-image:disabled {
    background: linear-gradient(135deg, 
        rgba(75, 85, 99, 0.6) 0%, 
        rgba(107, 114, 128, 0.4) 100%);
    color: rgba(156, 163, 175, 0.8);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Balance Display */
.dark #avatar-generator-modal .bg-yellow-50 {
    background: linear-gradient(135deg, 
        rgba(217, 119, 6, 0.15) 0%, 
        rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.dark #avatar-generator-modal #user-balance {
    color: #fbbf24;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Enhanced Preview Area */
.dark #avatar-generator-modal #avatar-generation-area {
    background: linear-gradient(135deg, 
        rgba(17, 24, 39, 0.8) 0%, 
        rgba(31, 41, 55, 0.6) 100%);
    border: 2px dashed rgba(75, 85, 99, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dark #avatar-generator-modal #avatar-generation-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, 
        rgba(59, 130, 246, 0.05) 0%, 
        rgba(147, 51, 234, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dark #avatar-generator-modal #avatar-generation-area:hover::before {
    opacity: 1;
}

.dark #avatar-generator-modal #avatar-placeholder {
    color: #9ca3af;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dark #avatar-generator-modal #generation-loading {
    color: #d1d5db;
}

.dark #avatar-generator-modal #generation-loading .animate-spin {
    border-color: transparent;
    border-top-color: #8b5cf6;
    border-right-color: #ec4899;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Enhanced Action Buttons */
.dark #avatar-generator-modal #avatar-actions button {
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dark #avatar-generator-modal #use-generated-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.dark #avatar-generator-modal #use-generated-avatar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.dark #avatar-generator-modal #save-avatar-only {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.dark #avatar-generator-modal #save-avatar-only:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.dark #avatar-generator-modal #regenerate-avatar {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.dark #avatar-generator-modal #regenerate-avatar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

/* Enhanced History Section */
.dark #avatar-generator-modal #avatar-history {
    scrollbar-width: thin;
    scrollbar-color: rgba(75, 85, 99, 0.8) transparent;
}

.dark #avatar-generator-modal #avatar-history::-webkit-scrollbar {
    width: 6px;
}

.dark #avatar-generator-modal #avatar-history::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.3);
    border-radius: 3px;
}

.dark #avatar-generator-modal #avatar-history::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(75, 85, 99, 0.8) 0%, 
        rgba(107, 114, 128, 0.6) 100%);
    border-radius: 3px;
}

.dark #avatar-generator-modal #avatar-history::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, 
        rgba(107, 114, 128, 0.9) 0%, 
        rgba(75, 85, 99, 0.8) 100%);
}

/* History Image Thumbnails */
.dark #avatar-generator-modal #avatar-history img {
    border: 2px solid rgba(75, 85, 99, 0.4);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark #avatar-generator-modal #avatar-history img:hover {
    border-color: rgba(59, 130, 246, 0.6);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2), 
                0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark #avatar-generator-modal #avatar-history img.selected {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3), 
                0 4px 16px rgba(59, 130, 246, 0.3);
}

/* Animation Effects */
@keyframes avatarShimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.dark #avatar-generator-modal .loading-shimmer {
    background: linear-gradient(90deg, 
        rgba(31, 41, 55, 0.8) 0%, 
        rgba(75, 85, 99, 0.4) 50%, 
        rgba(31, 41, 55, 0.8) 100%);
    background-size: 200px 100%;
    animation: avatarShimmer 1.5s infinite;
}

/* Responsive Enhancements */
@media (max-width: 1024px) {
    .dark #avatar-generator-modal .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .dark #avatar-generator-modal .avatar-generator-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .dark #avatar-generator-modal .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    .dark #avatar-generator-modal .preset-btn {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .dark #avatar-generator-modal .regional-slider {
        height: 10px;
    }
    
    .dark #avatar-generator-modal .regional-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
}

/* Dark mode semi-transparent gradients */
.dark .bg-gradient-to-r.from-yellow-50.to-orange-50,
.dark .from-yellow-900\/20.to-orange-900\/20 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(133, 77, 14, 0.2);  /* yellow-900 with 20% opacity */
    --tw-gradient-to: rgba(154, 52, 18, 0.2);    /* orange-900 with 20% opacity */
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* Avatar Generator Dark Mode Additional Styles */
.dark #avatar-generator-modal .from-purple-800\/30.to-pink-800\/30 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(107, 33, 168, 0.3);  /* purple-800 with 30% opacity */
    --tw-gradient-to: rgba(157, 23, 77, 0.3);     /* pink-800 with 30% opacity */
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark #avatar-generator-modal .bg-gradient-to-r.from-purple-600.to-pink-600 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #9333ea;  /* purple-600 */
    --tw-gradient-to: #db2777;    /* pink-600 */
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark #avatar-generator-modal .text-gray-700 {
    color: #e5e7eb;  /* gray-200 */
}

.dark #avatar-generator-modal .border {
    border-color: #4b5563;  /* gray-600 */
}

.dark #avatar-generator-modal .bg-white {
    background-color: #1f2937;  /* gray-800 */
}

/* 统一暗色主题按钮样式 */
.dark button {
    background-color: var(--button-bg);
    border: 1px solid var(--button-border);
    color: var(--text-color);
    padding: var(--button-padding);
    font-size: var(--button-font-size);
    line-height: var(--button-line-height);
    border-radius: var(--button-radius);
    transition: all 0.2s ease-in-out;
}

.dark button:hover {
    background-color: var(--button-hover-bg);
}

.dark .btn-primary {
    background-color: var(--primary-button-bg);
    border-color: var(--primary-button-border);
}

.dark .btn-primary:hover {
    background-color: var(--primary-button-hover-bg);
}

.dark .btn-secondary {
    background-color: var(--secondary-button-bg);
    border-color: var(--secondary-button-border);
}

.dark .btn-secondary:hover {
    background-color: var(--secondary-button-hover-bg);
}

/* 统一暗色主题模态窗口样式 */
.dark .modal-content {
    background-color: var(--modal-bg);
    border: 1px solid var(--modal-border);
    color: var(--text-color);
}

/* 统一暗色主题模态窗口样式 */
.dark .modal-content input,
.dark .modal-content textarea,
.dark .modal-content select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
}

.dark .modal-content input:focus,
.dark .modal-content textarea:focus,
.dark .modal-content select:focus {
    border-color: var(--input-focus-border);
    outline: none;
}

/* 移除所有模态窗口中的 !important */
.dark #dungeon-modal .modal-content,
.dark #wardrobe-modal .modal-content,
.dark #avatar-generator-modal .modal-content,
.dark #user-profile-modal .modal-content,
.dark #image-view-modal .modal-content {
    background-color: var(--modal-bg);
    border-color: var(--modal-border);
}

/* 统一暗色主题滚动条样式 */
.dark *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.dark *::-webkit-scrollbar-track {
    background: transparent;
}

.dark *::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg);
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.dark *::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-bg);
}

/* 统一暗色主题输入框样式 */
.dark input,
.dark textarea,
.dark select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    border-color: var(--input-focus-border);
    outline: none;
}

/* 确保所有模态窗口中的按钮样式一致 */
.dark #dungeon-modal button,
.dark #wardrobe-modal button,
.dark #avatar-generator-modal button,
.dark #user-profile-modal button,
.dark #image-view-modal button {
    background-color: var(--button-bg);
    border: 1px solid var(--button-border);
    color: var(--text-color);
    padding: var(--button-padding);
    font-size: var(--button-font-size);
    line-height: var(--button-line-height);
    border-radius: var(--button-radius);
}

.dark #dungeon-modal button:hover,
.dark #wardrobe-modal button:hover,
.dark #avatar-generator-modal button:hover,
.dark #user-profile-modal button:hover,
.dark #image-view-modal button:hover {
    background-color: var(--button-hover-bg);
}

/* 统一模态窗口中的主要按钮样式 */
.dark #dungeon-modal .btn-primary,
.dark #wardrobe-modal .btn-primary,
.dark #avatar-generator-modal .btn-primary,
.dark #user-profile-modal .btn-primary,
.dark #image-view-modal .btn-primary {
    background-color: var(--primary-button-bg);
    border-color: var(--primary-button-border);
}

.dark #dungeon-modal .btn-primary:hover,
.dark #wardrobe-modal .btn-primary:hover,
.dark #avatar-generator-modal .btn-primary:hover,
.dark #user-profile-modal .btn-primary:hover,
.dark #image-view-modal .btn-primary:hover {
    background-color: var(--primary-button-hover-bg);
}

/* 统一模态窗口中的次要按钮样式 */
.dark #dungeon-modal .btn-secondary,
.dark #wardrobe-modal .btn-secondary,
.dark #avatar-generator-modal .btn-secondary,
.dark #user-profile-modal .btn-secondary,
.dark #image-view-modal .btn-secondary {
    background-color: var(--secondary-button-bg);
    border-color: var(--secondary-button-border);
}

.dark #dungeon-modal .btn-secondary:hover,
.dark #wardrobe-modal .btn-secondary:hover,
.dark #avatar-generator-modal .btn-secondary:hover,
.dark #user-profile-modal .btn-secondary:hover,
.dark #image-view-modal .btn-secondary:hover {
    background-color: var(--secondary-button-hover-bg);
}

/* 统一模态窗口滚动条样式 */
.dark #dungeon-modal .modal-content::-webkit-scrollbar,
.dark #wardrobe-modal .modal-content::-webkit-scrollbar,
.dark #avatar-generator-modal .modal-content::-webkit-scrollbar,
.dark #user-profile-modal .modal-content::-webkit-scrollbar,
.dark #image-view-modal .modal-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.dark #dungeon-modal .modal-content::-webkit-scrollbar-track,
.dark #wardrobe-modal .modal-content::-webkit-scrollbar-track,
.dark #avatar-generator-modal .modal-content::-webkit-scrollbar-track,
.dark #user-profile-modal .modal-content::-webkit-scrollbar-track,
.dark #image-view-modal .modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.dark #dungeon-modal .modal-content::-webkit-scrollbar-thumb,
.dark #wardrobe-modal .modal-content::-webkit-scrollbar-thumb,
.dark #avatar-generator-modal .modal-content::-webkit-scrollbar-thumb,
.dark #user-profile-modal .modal-content::-webkit-scrollbar-thumb,
.dark #image-view-modal .modal-content::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg);
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.dark #dungeon-modal .modal-content::-webkit-scrollbar-thumb:hover,
.dark #wardrobe-modal .modal-content::-webkit-scrollbar-thumb:hover,
.dark #avatar-generator-modal .modal-content::-webkit-scrollbar-thumb:hover,
.dark #user-profile-modal .modal-content::-webkit-scrollbar-thumb:hover,
.dark #image-view-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-bg);
}

/* Dark mode semi-transparent gradients */
.dark .bg-gradient-to-r.from-green-50.to-blue-50,
.dark .from-green-900\/20.to-blue-900\/20 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: rgba(6, 78, 59, 0.2);  /* green-900 with 20% opacity */
    --tw-gradient-to: rgba(30, 58, 138, 0.2);  /* blue-900 with 20% opacity */
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* Dark mode button gradient */
.dark .bg-gradient-to-r.from-green-400.to-green-600 {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
    --tw-gradient-from: #34d399;  /* green-400 */
    --tw-gradient-to: #059669;    /* green-600 */
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* Dark mode text colors */
.dark .text-green-600 {
    color: #34d399;  /* green-400 */
}

.dark .text-green-400 {
    color: #4ade80;  /* green-400 */
}

/* Dark mode border colors */
.dark .border-green-200 {
    border-color: #4b5563;  /* gray-600 */
}

.dark .border-green-700 {
    border-color: #065f46;  /* green-700 */
}

/* 分享按钮动画效果 */
.share-button-animation {
    animation: shareButtonPulse 0.6s ease-in-out;
}

@keyframes shareButtonPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.5);
    }
    100% {
        transform: scale(1);
    }
}

/* 图片查看模态窗口分享按钮特殊样式 */
#image-view-modal #share-image-btn {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

#image-view-modal #share-image-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

#image-view-modal #share-image-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* 深色模式下的分享按钮样式 */
.dark #image-view-modal #share-image-btn {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.dark #image-view-modal #share-image-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-message {
    font-size: 14px;
    color: #262626;
}

.notification-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
