/* AuraChat 主样式文件 */

/* CSS重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 柔和天蓝色系 */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    
    /* 中性色 - 白色和浅灰色 */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    
    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* 辅助色 - 柔和色调 */
    --purple-soft: #a78bfa;
    --pink-soft: #f472b6;
    --green-soft: #34d399;
    --yellow-soft: #fbbf24;
    
    /* 布局变量 */
    --sidebar-width: 320px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --input-height: 56px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    /* 玻璃态效果 */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --backdrop-blur: blur(10px);
    
    /* 过渡动画 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* 字体 */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* 深色主题变量 */
[data-theme="dark"] {
    --primary-50: #0c4a6e;
    --primary-100: #075985;
    --primary-200: #0369a1;
    --primary-300: #0284c7;
    --primary-400: #0ea5e9;
    --primary-500: #38bdf8;
    --primary-600: #7dd3fc;
    --primary-700: #bae6fd;
    --primary-800: #e0f2fe;
    --primary-900: #f0f9ff;
    
    --neutral-50: #171717;
    --neutral-100: #262626;
    --neutral-200: #404040;
    --neutral-300: #525252;
    --neutral-400: #737373;
    --neutral-500: #a3a3a3;
    --neutral-600: #d4d4d4;
    --neutral-700: #e5e5e5;
    --neutral-800: #f5f5f5;
    --neutral-900: #fafafa;
    
    --glass-bg: rgba(30, 30, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 基础样式 */
html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--neutral-800);
    background: var(--neutral-50);
    line-height: 1.5;
    height: 100%;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.aura-theme {
    background: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
}

/* 容器布局 */
.app-container {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), width var(--transition-normal);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 16px;
    overflow: hidden;
}

/* 侧边栏头部 */
.sidebar-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.logo-icon {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, var(--primary-400), var(--purple-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: var(--shadow-md);
}

.logo-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: inherit;
    opacity: 0.4;
    animation: pulse 2s infinite;
}

.logo-text h1 {
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--primary-600), var(--purple-soft));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 4px;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--neutral-500);
    font-weight: var(--font-weight-medium);
}

/* 新建对话按钮 */
.btn-new-chat {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-semibold);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-new-chat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
}

.btn-new-chat:active {
    transform: translateY(0);
}

.btn-new-chat::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;
}

.btn-new-chat:hover::before {
    left: 100%;
}

/* 模型选择器 */
.model-selector-container {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-700);
    font-size: 14px;
}

.section-title i {
    color: var(--primary-500);
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-dropdown {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    background: white;
    color: var(--neutral-800);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.model-dropdown:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-sm);
}

.model-dropdown:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.model-info {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-100);
    color: var(--primary-600);
    border-radius: 50%;
    cursor: help;
    font-size: 14px;
}

.model-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 200px;
    padding: 12px;
    background: var(--neutral-800);
    color: white;
    border-radius: var(--border-radius-md);
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.model-info:hover .model-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 对话历史区域 */
.conversations-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* 自定义滚动条 */
.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 10px;
}

.conversations-list::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

/* 对话项 */
.conversation-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.conversation-item:hover {
    background: white;
    border-color: var(--primary-200);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.conversation-item.active {
    background: white;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 1px var(--primary-500), var(--shadow-sm);
}

.conversation-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 6px;
}

.conversation-title {
    font-weight: var(--font-weight-medium);
    font-size: 14px;
    color: var(--neutral-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conversation-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}

.conversation-preview {
    font-size: 12px;
    color: var(--neutral-600);
    line-height: 1.4;
    height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.conversation-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--neutral-500);
}

.conversation-model {
    background: var(--primary-100);
    color: var(--primary-700);
    padding: 2px 6px;
    border-radius: var(--border-radius-full);
    font-weight: var(--font-weight-medium);
}

.conversation-time {
    font-size: 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--neutral-500);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 12px;
}

/* 用户资料 */
.user-profile {
    padding: 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    margin-top: auto;
}

.profile-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-container {
    position: relative;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400), var(--purple-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
}

.avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid white;
}

.avatar-status.online {
    background: var(--success);
}

.avatar-status.away {
    background: var(--warning);
}

.avatar-status.offline {
    background: var(--neutral-400);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.username {
    font-weight: var(--font-weight-semibold);
    font-size: 14px;
    color: var(--neutral-800);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--neutral-500);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-actions {
    display: flex;
    gap: 4px;
}

/* 主聊天区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

.chat-title {
    flex: 1;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.chat-header h2 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-800);
    margin: 0;
}

.title-edit {
    display: none;
    align-items: center;
    gap: 8px;
}

#conversationTitleInput {
    flex: 1;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--primary-300);
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-800);
    background: white;
}

#conversationTitleInput:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

.conversation-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.model-badge {
    background: var(--primary-100);
    color: var(--primary-700);
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-count {
    font-size: 12px;
    color: var(--neutral-500);
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    height: 36px;
    padding: 0 16px;
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    color: var(--neutral-700);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-action:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    color: var(--neutral-800);
    transform: translateY(-1px);
}

.btn-action:active {
    transform: translateY(0);
}

/* 聊天消息容器 */
.chat-messages-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 欢迎消息 */
.welcome-message {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.welcome-icon {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
}

.welcome-orb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400), var(--purple-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
}

.welcome-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--primary-300);
    border-radius: 50%;
    opacity: 0;
}

.ring-1 {
    width: 140px;
    height: 140px;
    animation: ringPulse 3s infinite 0s;
}

.ring-2 {
    width: 160px;
    height: 160px;
    animation: ringPulse 3s infinite 0.5s;
}

.ring-3 {
    width: 180px;
    height: 180px;
    animation: ringPulse 3s infinite 1s;
}

.welcome-content h3 {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-600), var(--purple-soft));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--neutral-600);
    margin-bottom: 40px;
    line-height: 1.6;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-normal);
}

.feature:hover {
    transform: translateY(-4px);
    background: white;
    box-shadow: var(--shadow-md);
}

.feature i {
    font-size: 24px;
    color: var(--primary-500);
    margin-bottom: 12px;
}

.feature span {
    display: block;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 8px;
    color: var(--neutral-800);
}

.feature p {
    font-size: 14px;
    color: var(--neutral-600);
    line-height: 1.4;
}

.prompt-suggestions {
    max-width: 600px;
    margin: 0 auto;
}

.suggestions-title {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--neutral-600);
    margin-bottom: 16px;
    text-align: left;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.prompt-suggestion {
    padding: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 12px;
}

.prompt-suggestion:hover {
    background: white;
    border-color: var(--primary-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.suggestion-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    background: var(--primary-100);
    color: var(--primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.suggestion-content {
    flex: 1;
}

.suggestion-content strong {
    display: block;
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-800);
    margin-bottom: 4px;
    font-size: 14px;
}

.suggestion-content p {
    font-size: 12px;
    color: var(--neutral-600);
    line-height: 1.4;
}

/* 消息样式 */
.message {
    display: flex;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: messageSlideIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.message-visible {
    opacity: 1;
    transform: translateY(0);
}

.message-user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.message-user .message-avatar {
    background: linear-gradient(135deg, var(--purple-soft), var(--pink-soft));
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-user .message-content {
    display: flex;
    justify-content: flex-end;
}

.message-bubble {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: var(--border-radius-lg);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.message-assistant .message-bubble {
    background: white;
    border: 1px solid var(--glass-border);
    border-top-left-radius: 4px;
}

.message-user .message-bubble {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-top-right-radius: 4px;
}

/* 气泡小箭头 */
.message-bubble::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: inherit;
    transform: rotate(45deg);
}

.message-assistant .message-bubble::before {
    left: -6px;
    top: 20px;
    border-left: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.message-user .message-bubble::before {
    right: -6px;
    top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.message-text {
    line-height: 1.6;
    font-size: 15px;
}

.message-user .message-text {
    color: white;
}

.message-time {
    font-size: 11px;
    color: var(--neutral-500);
    margin-top: 8px;
    text-align: right;
}

.message-user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Markdown样式 */
.md-paragraph {
    margin-bottom: 16px;
    line-height: 1.7;
}

.md-paragraph:last-child {
    margin-bottom: 0;
}

.md-code-block {
    margin: 20px 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
}

.md-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--neutral-100);
    border-bottom: 1px solid var(--neutral-200);
    font-size: 13px;
}

.md-code-language {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: var(--font-weight-medium);
    color: var(--neutral-700);
}

.md-copy-button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--neutral-600);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.md-copy-button:hover {
    background: var(--neutral-200);
    color: var(--neutral-800);
}

.md-copy-button.copied {
    color: var(--success);
}

.md-code-block pre {
    margin: 0;
    padding: 16px;
    background: var(--neutral-50);
    overflow-x: auto;
}

.md-code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.md-table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--neutral-200);
}

.md-table {
    width: 100%;
    border-collapse: collapse;
}

.md-table th {
    background: var(--neutral-100);
    padding: 12px 16px;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-800);
    border-bottom: 2px solid var(--neutral-200);
}

.md-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--neutral-200);
}

.md-table tr:last-child td {
    border-bottom: none;
}

.md-table tr:hover {
    background: var(--neutral-50);
}

.md-blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--primary-50);
    border-left: 4px solid var(--primary-500);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    font-style: italic;
    color: var(--neutral-700);
}

.md-task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.md-task-item i {
    color: var(--neutral-400);
    font-size: 16px;
}

.md-task-item.checked i {
    color: var(--success);
}

.md-list-item {
    margin-bottom: 8px;
    padding-left: 4px;
}

/* 输入区域 */
.chat-input-container {
    padding: 20px 24px;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    z-index: 50;
}

.input-wrapper {
    position: relative;
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.input-wrapper:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), var(--shadow-md);
    transform: translateY(-2px);
}

.input-border-animation {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-400), var(--purple-soft), var(--pink-soft), var(--primary-400));
    background-size: 400% 100%;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.input-wrapper:focus-within .input-border-animation {
    opacity: 1;
    animation: gradientFlow 3s linear infinite;
}

#messageInput {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.5;
    color: var(--neutral-800);
    background: transparent;
    max-height: 200px;
    min-height: 24px;
}

#messageInput::placeholder {
    color: var(--neutral-500);
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--neutral-100);
    color: var(--neutral-700);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--neutral-200);
    color: var(--neutral-800);
    transform: translateY(-1px);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon.small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.btn-send {
    height: 40px;
    padding: 0 24px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-semibold);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
}

.btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.input-hints {
    display: flex;
    gap: 16px;
}

.hint {
    font-size: 12px;
    color: var(--neutral-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.hint i {
    font-size: 10px;
}

.input-stats {
    font-size: 12px;
    color: var(--neutral-500);
}

/* 滚动到底部按钮 */
.scroll-to-bottom {
    position: absolute;
    bottom: 100px;
    right: 32px;
    width: 44px;
    height: 44px;
    border: none;
    background: white;
    color: var(--neutral-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    z-index: 10;
}

.scroll-to-bottom.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-bottom:hover {
    background: var(--neutral-100);
    color: var(--primary-600);
    transform: translateY(-4px);
}

/* 按钮通用样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-semibold);
    padding: 12px 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--neutral-700);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-medium);
    padding: 12px 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    transform: translateY(-1px);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content.small {
    max-width: 400px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--neutral-100);
    color: var(--neutral-600);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--neutral-200);
    color: var(--neutral-800);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* 设置页面样式 */
.settings-section {
    margin-bottom: 32px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 16px;
    color: var(--neutral-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-item {
    margin-bottom: 20px;
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item label {
    display: block;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--neutral-700);
    margin-bottom: 8px;
}

.settings-item input[type="text"],
.settings-item input[type="range"] {
    width: 100%;
}

.settings-item input[type="range"] {
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--neutral-200);
    border-radius: 2px;
    outline: none;
}

.settings-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-500);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

#temperatureValue {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-600);
}

.theme-selector {
    display: flex;
    gap: 12px;
}

.theme-option {
    flex: 1;
    padding: 16px;
    background: var(--neutral-100);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.theme-option:hover {
    background: var(--neutral-200);
}

.theme-option.active {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.theme-preview {
    width: 60px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--neutral-300);
}

.theme-preview.light {
    background: linear-gradient(135deg, #f8fafc 25%, #e2e8f0 75%);
}

.theme-preview.dark {
    background: linear-gradient(135deg, #1e293b 25%, #334155 75%);
}

.theme-preview.auto {
    background: linear-gradient(90deg, #f8fafc 50%, #1e293b 50%);
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.notification {
    padding: 16px 20px;
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    animation: slideInRight 0.3s ease forwards;
    border-left: 4px solid;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--error);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.info {
    border-left-color: var(--info);
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.error .notification-icon {
    color: var(--error);
}

.notification.warning .notification-icon {
    color: var(--warning);
}

.notification.info .notification-icon {
    color: var(--info);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: var(--font-weight-semibold);
    margin-bottom: 4px;
    color: var(--neutral-800);
}

.notification-message {
    font-size: 14px;
    color: var(--neutral-600);
}

.notification-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--neutral-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.notification-close:hover {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

/* 工具提示 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background: var(--neutral-800);
    color: white;
    font-size: 12px;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* 移动端侧边栏切换 */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border: none;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    z-index: 90;
    transition: all var(--transition-normal);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 80;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 100;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .chat-header {
        padding: 16px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .welcome-features {
        grid-template-columns: 1fr;
    }
    
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .chat-actions .btn-action span {
        display: none;
    }
    
    .chat-actions .btn-action {
        width: 40px;
        padding: 0;
        justify-content: center;
    }
    
    .input-hints {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-content {
        margin: 0 16px;
    }
}

@media (max-width: 480px) {
    .chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .chat-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .input-actions {
        flex-wrap: wrap;
    }
    
    .btn-send .send-text {
        display: none;
    }
    
    .btn-send {
        width: 40px;
        padding: 0;
        justify-content: center;
    }
}

/* 认证页面样式 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--neutral-100) 100%);
    position: relative;
    overflow: hidden;
}

.auth-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-300);
    top: -150px;
    right: -150px;
    animation: floatOrb 20s infinite ease-in-out;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: var(--purple-soft);
    bottom: -100px;
    left: 10%;
    animation: floatOrb 25s infinite ease-in-out reverse;
}

.orb-3 {
    width: 150px;
    height: 150px;
    background: var(--pink-soft);
    top: 30%;
    right: 20%;
    animation: floatOrb 30s infinite ease-in-out;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.8) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.6) 0%, transparent 50%);
}

.auth-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

.back-home {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--neutral-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
    z-index: 10;
}

.back-home:hover {
    color: var(--primary-600);
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    position: relative;
}

.card-decoration {
    height: 120px;
    background: linear-gradient(135deg, var(--primary-400), var(--purple-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.decoration-orb {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    position: relative;
    z-index: 2;
}

.decoration-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: rotateRing 20s linear infinite;
}

.card-content {
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-600), var(--purple-soft));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--neutral-600);
}

.auth-form {
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--neutral-700);
    margin-bottom: 8px;
}

.form-group label i {
    color: var(--primary-500);
    width: 16px;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    background: white;
    color: var(--neutral-800);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--neutral-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.toggle-password:hover {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

.password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--neutral-200);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.strength-text {
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    min-width: 24px;
}

.form-hint {
    font-size: 12px;
    color: var(--neutral-500);
    margin-top: 4px;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--neutral-700);
    cursor: pointer;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-600);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--primary-700);
}

.auth-btn {
    width: 100%;
    height: 52px;
    font-size: 16px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--neutral-500);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--neutral-300);
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--neutral-600);
}

.auth-link {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: color var(--transition-fast);
}

.auth-link:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.terms-link {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.terms-link:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.demo-hint {
    padding: 16px;
    background: var(--primary-50);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--primary-200);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.demo-hint i {
    color: var(--primary-600);
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.demo-hint p {
    font-size: 14px;
    color: var(--neutral-700);
    line-height: 1.5;
}

.demo-hint strong {
    color: var(--primary-700);
    font-weight: var(--font-weight-semibold);
}

.auth-footer-page {
    margin-top: 32px;
    text-align: center;
    font-size: 14px;
    color: var(--neutral-600);
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: var(--neutral-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-600);
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.hidden {
    display: none !important;
}

/* 高亮.js 自定义样式 */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* 加载覆盖层样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary-200);
    border-top: 4px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 16px;
    color: var(--neutral-700);
    font-weight: var(--font-weight-medium);
}

/* 错误覆盖层样式 */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-50), var(--neutral-100));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.error-content {
    max-width: 500px;
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--glass-border);
}

.error-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 32px;
}

.error-content h2 {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--neutral-800);
    margin-bottom: 12px;
}

.error-content p {
    font-size: 16px;
    color: var(--neutral-600);
    margin-bottom: 32px;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 连接状态指示器 */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow-md);
}

.connection-status.connected {
    background: var(--success);
    color: white;
}

.connection-status.disconnected {
    background: var(--warning);
    color: white;
}

.connection-status.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

/* 自定义工具提示 */
.custom-tooltip {
    position: absolute;
    background: var(--neutral-800);
    color: white;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--neutral-800);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .error-content {
        padding: 24px;
        margin: 20px;
    }
    
    .error-actions {
        flex-direction: column;
    }
    
    .connection-status {
        top: 10px;
        right: 10px;
        left: 10px;
        justify-content: center;
    }
}

/* 暗色主题调整 */
[data-theme="dark"] .loading-overlay {
    background: rgba(30, 30, 30, 0.9);
}

[data-theme="dark"] .loading-text {
    color: var(--neutral-300);
}

[data-theme="dark"] .error-content {
    background: var(--neutral-800);
    color: var(--neutral-100);
}

[data-theme="dark"] .error-content h2 {
    color: var(--neutral-100);
}

[data-theme="dark"] .error-content p {
    color: var(--neutral-300);
}

/* 打字光标 */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--primary-600);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}