        :root {
            --primary-color: #e6d7ff;
            --secondary-color: #d8bfd8;
            --accent-color: #ba9bde;
            --dark-purple: #9370db;
            --text-color: #5d4a75;
            --light-bg: #f9f5ff;
            --shadow: 0 8px 25px rgba(149, 102, 204, 0.15);
            --border-radius: 20px;
            --transition: all 0.3s ease;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', 'YouYuan', sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #f5f0ff 0%, #e6e6fa 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            color: var(--text-color);
            position: relative;
            overflow-x: hidden;
        }
        
        .chinese-pattern {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                radial-gradient(circle at 20% 30%, rgba(182, 102, 210, 0.05) 0%, transparent 20%),
                radial-gradient(circle at 80% 70%, rgba(147, 112, 219, 0.05) 0%, transparent 20%),
                radial-gradient(circle at 40% 80%, rgba(216, 191, 216, 0.05) 0%, transparent 20%);
            z-index: -2;
            pointer-events: none;
        }
        
        .main-container {
            display: flex;
            width: 100%;
            max-width: 1200px;
            height: 85vh;
            background: rgba(255, 255, 255, 0.85);
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            overflow: hidden;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(230, 215, 255, 0.5);
            position: relative;
        }
        
        .sidebar {
            width: 320px;
            background: rgba(249, 245, 255, 0.9);
            padding: 25px;
            display: flex;
            flex-direction: column;
            border-right: 1px solid rgba(230, 215, 255, 0.5);
            overflow-y: auto;
            border-radius: var(--border-radius) 0 0 var(--border-radius);
        }
        
        .user-info {
            text-align: center;
            padding: 20px 0;
            border-bottom: 1px solid rgba(230, 215, 255, 0.8);
            margin-bottom: 20px;
        }
        
        .user-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            margin: 0 auto 15px;
            background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            color: white;
            box-shadow: 0 5px 15px rgba(147, 112, 219, 0.3);
        }
        
        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }
        
        .user-name {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 5px;
            color: var(--text-color);
        }
        
        .user-zodiac {
            font-size: 14px;
            color: var(--accent-color);
            background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .fortune-card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(249, 245, 255, 0.9));
            border-radius: 15px;
            padding: 18px;
            margin-bottom: 20px;
            box-shadow: 0 4px 15px rgba(147, 112, 219, 0.1);
            border: 1px solid rgba(230, 215, 255, 0.5);
        }
        
        .fortune-header {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }
        
        .fortune-icon {
            font-size: 24px;
            margin-right: 10px;
            color: var(--dark-purple);
        }
        
        .fortune-title {
            font-size: 16px;
            font-weight: 600;
        }
        
        .fortune-content {
            font-size: 14px;
            line-height: 1.6;
            color: var(--text-color);
        }
        
        .settings-form {
            margin-top: auto;
        }
        
        .settings-form h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }
        
        .settings-form h3 i {
            margin-right: 8px;
            color: var(--accent-color);
        }
        
        .form-group {
            margin-bottom: 15px;
        }
        
        .form-label {
            display: block;
            font-size: 14px;
            margin-bottom: 6px;
            color: var(--text-color);
        }
        
        .form-input, .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid rgba(230, 215, 255, 0.8);
            border-radius: 10px;
            font-size: 14px;
            background: rgba(255, 255, 255, 0.7);
            transition: var(--transition);
        }
        
        .form-input:focus, .form-select:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(186, 155, 222, 0.2);
        }
        
        .btn {
            padding: 10px 15px;
            border: none;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
            color: white;
            width: 100%;
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(147, 112, 219, 0.4);
        }
        
        .btn-secondary {
            background: rgba(230, 215, 255, 0.5);
            color: var(--text-color);
            width: 100%;
            margin-top: 10px;
        }
        
        .btn-secondary:hover {
            background: rgba(230, 215, 255, 0.7);
        }
        
        .conv-list {
            max-height: 120px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-top: 8px;
        }
        
        .conv-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 10px;
            background: rgba(0, 0, 0, 0.03);
            border-radius: 8px;
            font-size: 13px;
        }
        
        .conv-item.active {
            background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
            color: white;
        }
        
        .conv-item button {
            background: none;
            border: none;
            font-size: 13px;
            cursor: pointer;
            color: inherit;
            text-align: left;
            flex: 1;
            padding: 4px 0;
        }
        
        .fold-btn {
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            margin-left: auto;
        }
        
        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 0 var(--border-radius) var(--border-radius) 0;
        }
        
        .chat-header {
            padding: 20px 25px;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(230, 215, 255, 0.5);
            border-radius: 0 var(--border-radius) 0 0;
        }
        
        .chat-title {
            font-size: 22px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .chat-status {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
        }
        
        .status-dot {
            width: 8px;
            height: 8px;
            background: #7cfc00;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        .chat-content {
            flex: 1;
            padding: 25px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .welcome-message {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-color);
        }
        
        .welcome-title {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 8px;
            background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .welcome-subtitle {
            font-size: 16px;
            opacity: 0.8;
            margin-bottom: 30px;
        }
        
        .message {
            display: flex;
            gap: 12px;
            animation: fadeIn 0.3s ease-out;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .message-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
            overflow: hidden;
        }
        
        .message-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }
        
        .user-avatar-small {
            background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
            color: white;
        }
        
        .ai-avatar-small {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
        }
        
        .message-content {
            max-width: 70%;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .message-bubble {
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 15px;
            line-height: 1.5;
            word-wrap: break-word;
            overflow-wrap: break-word;
            box-shadow: 0 2px 8px rgba(147, 112, 219, 0.1);
        }
        
        .user-message .message-bubble {
            background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
            color: white;
            border-bottom-right-radius: 5px;
        }
        
        .ai-message .message-bubble {
            background: white;
            color: var(--text-color);
            border: 1px solid rgba(230, 215, 255, 0.8);
            border-bottom-left-radius: 5px;
        }
        
        .message-time {
            font-size: 12px;
            color: var(--text-color);
            opacity: 0.7;
        }
        
        .input-area {
            padding: 20px 25px;
            background: rgba(249, 245, 255, 0.7);
            border-top: 1px solid rgba(230, 215, 255, 0.5);
            display: flex;
            gap: 15px;
            align-items: flex-end;
            border-radius: 0 0 var(--border-radius) 0;
        }
        
        .input-wrapper {
            flex: 1;
            position: relative;
        }
        
        .chat-input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid rgba(230, 215, 255, 0.8);
            border-radius: 20px;
            font-size: 15px;
            resize: none;
            max-height: 120px;
            background: rgba(255, 255, 255, 0.8);
            transition: var(--transition);
        }
        
        .chat-input:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(186, 155, 222, 0.2);
        }
        
        .input-buttons {
            display: flex;
            gap: 8px;
        }
        
        .btn-text {
            display: inline;
        }
        
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10000;
            backdrop-filter: blur(5px);
        }
        
        .modal-content {
            background: white;
            border-radius: var(--border-radius);
            padding: 30px;
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: modalSlideIn 0.3s ease-out;
        }
        
        @keyframes modalSlideIn {
            from { transform: translateY(-30px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        
        .modal-title {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 20px;
            background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-align: center;
        }
        
        .type-selection {
            display: flex;
            gap: 15px;
            margin-bottom: 25px;
        }
        
        .type-option {
            flex: 1;
            padding: 20px;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            text-align: center;
            cursor: pointer;
            transition: var(--transition);
        }
        
        .type-option:hover {
            border-color: var(--accent-color);
            transform: translateY(-2px);
        }
        
        .type-option.active {
            border-color: var(--accent-color);
            background: rgba(186, 155, 222, 0.05);
        }
        
        .type-option h3 {
            font-size: 18px;
            margin-bottom: 10px;
            color: var(--text-color);
        }
        
        .type-option p {
            font-size: 14px;
            color: var(--text-color);
            opacity: 0.8;
        }
        
        .type-form {
            display: none;
            animation: fadeIn 0.3s ease-in;
        }
        
        .petal {
            position: fixed;
            width: 20px;
            height: 20px;
            background: rgba(230, 215, 255, 0.7);
            border-radius: 50% 0 50% 50%;
            transform: rotate(45deg);
            z-index: -1;
            animation: fall linear infinite;
        }
        
        @keyframes fall {
            0% {
                transform: translateY(-100px) rotate(0deg);
                opacity: 0;
            }
            10% {
                opacity: 0.7;
            }
            90% {
                opacity: 0.7;
            }
            100% {
                transform: translateY(100vh) rotate(360deg);
                opacity: 0;
            }
        }
        
        @media (max-width: 900px) {
            .main-container {
                flex-direction: column;
                height: 95vh;
            }
            
            .sidebar {
                width: 100%;
                height: auto;
                max-height: 40vh;
                overflow-y: auto;
                border-radius: var(--border-radius) var(--border-radius) 0 0;
            }
            
            .chat-container {
                height: 60vh;
                border-radius: 0 0 var(--border-radius) var(--border-radius);
            }
            
            .message-content {
                max-width: 85%;
            }
            
            .type-selection {
                flex-direction: column;
            }
        }
        
        .typing-indicator {
            display: flex;
            gap: 4px;
            padding: 12px 16px;
            background: white;
            border-radius: 18px;
            border-bottom-left-radius: 4px;
            width: fit-content;
        }
        
        .typing-dot {
            width: 8px;
            height: 8px;
            background: var(--text-color);
            border-radius: 50%;
            animation: typing 1.4s infinite ease-in-out;
        }
        
        .typing-dot:nth-child(1) { animation-delay: -0.32s; }
        .typing-dot:nth-child(2) { animation-delay: -0.16s; }
        
        @keyframes typing {
            0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
            40% { transform: scale(1); opacity: 1; }
        }
        
        
        :root {
    --primary-color: #f0e6ff;
    --secondary-color: #e6d4f7;
    --accent-color: #d4b8ff;
    --dark-purple: #b19cd9;
    --light-purple: #f8f4ff;
    --pink-accent: #ffd6e7;
    --text-color: #7a6b8a;
    --text-dark: #5d4a75;
    --light-bg: #fefaff;
    --shadow: 0 8px 30px rgba(182, 162, 222, 0.15);
    --shadow-soft: 0 4px 20px rgba(182, 162, 222, 0.1);
    --border-radius: 24px;
    --border-radius-small: 16px;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'YouYuan', 'STKaiti', sans-serif;
}

body {
    background: linear-gradient(135deg, #f9f4ff 0%, #f0e8ff 50%, #e8deff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-color);
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* 古风背景图案 */
.chinese-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30,30 Q50,20 70,30 T90,50 Q80,70 70,70 T50,90 Q20,80 30,30' fill='none' stroke='%23d4b8ff' stroke-width='0.3' opacity='0.05'/%3E%3C/svg%3E"),
        radial-gradient(circle at 15% 25%, rgba(255, 214, 231, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 75%, rgba(177, 156, 217, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 35% 85%, rgba(230, 212, 247, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 65% 15%, rgba(240, 230, 255, 0.08) 0%, transparent 25%);
    z-index: -2;
    pointer-events: none;
}

/* 添加花瓣装饰 */
.petal-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.petal-decoration::before,
.petal-decoration::after {
    content: '❀';
    position: absolute;
    font-size: 24px;
    color: rgba(177, 156, 217, 0.3);
    animation: float 8s infinite ease-in-out;
}

.petal-decoration::before {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.petal-decoration::after {
    top: 20%;
    right: 8%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.main-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 85vh;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 244, 255, 0.98) 100%);
    border-radius: var(--border-radius);
    box-shadow: 
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(230, 212, 247, 0.3);
    overflow: hidden;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(240, 230, 255, 0.8);
    position: relative;
}

/* 添加柔光效果 */
.main-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* 侧边栏样式优化 */
/*.sidebar {*/
/*    width: 280px;*/
/*    background: linear-gradient(160deg, var(--light-purple) 0%, var(--secondary-color) 100%);*/
/*    padding: 25px;*/
/*    border-right: 1px solid rgba(230, 212, 247, 0.6);*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    position: relative;*/
/*    overflow: hidden;*/
/*}*/

/*.sidebar::before {*/
/*    content: '';*/
/*    position: absolute;*/
/*    top: 0;*/
/*    left: 0;*/
/*    right: 0;*/
/*    height: 1px;*/
/*    background: linear-gradient(90deg, transparent, rgba(177, 156, 217, 0.4), transparent);*/
/*}*/

.logo-area {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    position: relative;
}

.logo-area::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.logo-area h1 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: normal;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.logo-area p {
    font-size: 13px;
    color: var(--text-color);
    opacity: 0.8;
}

/* 占卜类型选择优化 */
.divination-type {
    margin-bottom: 25px;
}

.type-option {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(230, 212, 247, 0.5);
    border-radius: var(--border-radius-small);
    padding: 15px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.type-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: var(--transition);
}

.type-option:hover::before {
    left: 100%;
}

.type-option:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
}

.type-option.active {
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(177, 156, 217, 0.3);
}

/* 表单样式优化 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(230, 212, 247, 0.5);
    border-radius: var(--border-radius-small);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-dark);
    transition: var(--transition);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(177, 156, 217, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

/* 对话列表优化 */
.conversation-list {
    flex: 1;
    overflow-y: auto;
    margin-right: -10px;
    padding-right: 5px;
}

.conversation-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(230, 212, 247, 0.4);
    border-radius: var(--border-radius-small);
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
    border-color: var(--accent-color);
}

.conversation-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
}

/* 主聊天区域优化 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, rgba(248, 244, 255, 0.9) 0%, rgba(240, 230, 255, 0.95) 100%);
}

.chat-header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    padding: 20px 25px;
    border-bottom: 1px solid rgba(230, 212, 247, 0.6);
}

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

/* 消息气泡优化 */
.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

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

.ai-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px;
    flex-shrink: 0;
}

.user-avatar {
    background: linear-gradient(135deg, var(--pink-accent), #CA8BF7);
    color: #ff6b95;
    box-shadow: 0 4px 12px rgba(177, 156, 217, 0.4);
}

.ai-avatar {
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    color: white;
    box-shadow: 0 4px 12px rgba(177, 156, 217, 0.3);
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(230, 212, 247, 0.5);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    line-height: 1.5;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #ffc2e0);
    border-color: rgba(230, 212, 247, 0.5);
    color: #8a4b6e;
}

.message-time {
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

/* 输入区域优化 */
.chat-input {
    padding: 20px 25px;
    border-top: 1px solid rgba(230, 212, 247, 0.6);
    background: linear-gradient(0deg, var(--primary-color) 0%, transparent 100%);
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 18px;
    border: 2px solid rgba(230, 212, 247, 0.5);
    border-radius: var(--border-radius-small);
    background: rgba(255, 255, 255, 0.9);
    resize: none;
    transition: var(--transition);
}

#userInput:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(177, 156, 217, 0.2);
}

.send-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    padding: 12px 24px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(177, 156, 217, 0.3);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(177, 156, 217, 0.4);
}

.send-btn:active {
    transform: translateY(0);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(230, 212, 247, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-purple);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: 90vh;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
    }
    
    body {
        padding: 10px;
    }
}

/* 添加古风边框装饰 */
.decorative-border {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.decorative-border.top {
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.decorative-border.bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

        /* 消息布局优化 - 用户消息头像在右侧 */
.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.user-message {
    justify-content: flex-end;
    flex-direction: row-reverse; /* 关键修改：反转用户消息的布局 */
}

.ai-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px;
    flex-shrink: 0;
    order: 2; /* 用户消息中头像放在右侧 */
}

.user-message .message-avatar {
    order: 2; /* 用户头像在右侧 */
    margin-left: 12px;
    margin-right: 0;
}

.ai-message .message-avatar {
    order: 1; /* AI头像在左侧 */
    margin-left: 0;
    margin-right: 12px;
}

.message-content {
    max-width: 70%;
    order: 1; /* 内容在左侧 */
}

.user-message .message-content {
    order: 1; /* 用户消息内容在左侧 */
}

.ai-message .message-content {
    order: 2; /* AI消息内容在右侧 */
}

.user-avatar-small {
    background: linear-gradient(135deg, var(--pink-accent), #CA8BF7);
    color: white;
    box-shadow: 0 4px 12px rgba(177, 156, 217, 0.3);
}

.ai-avatar-small {
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    color: white;
    box-shadow: 0 4px 12px rgba(177, 156, 217, 0.3);
}

.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(230, 212, 247, 0.5);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    line-height: 1.5;
    position: relative;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #ffc2e0);
    border-color: rgba(255, 182, 217, 0.3);
    color: #8a4b6e;
    border-bottom-right-radius: 5px; /* 用户消息气泡右下角小圆角 */
}

.ai-message .message-bubble {
    border-bottom-left-radius: 5px; /* AI消息气泡左下角小圆角 */
}
.message-time {
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
   text-align: left; /* 用户消息时间右对齐 */
}


.ai-message .message-time {
    text-align: right; /* AI消息时间左对齐 */
}
.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(230, 212, 247, 0.5);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    line-height: 1.5;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #ffc2e0);
    border-color: rgba(230, 212, 247, 0.5);
    color: #8a4b6e;
}

:root {
    --primary-color: #f5eeff;
    --secondary-color: #e8dfff;
    --accent-color: #d8c8ff;
    --dark-purple: #c5b1ff;
    --pink-accent: #ffd6e8;
    --text-color: #8a7ba5;
    --text-dark: #6d5b8e;
    --light-bg: #fefcff;
    --shadow: 0 6px 20px rgba(197, 177, 255, 0.12);
    --shadow-soft: 0 3px 15px rgba(197, 177, 255, 0.08);
    --border-radius: 28px;
    --border-radius-small: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'YouYuan', 'STKaiti', sans-serif;
}

body {
    background: linear-gradient(135deg, #faf6ff 0%, #f3edff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    color: var(--text-color);
    position: relative;
    overflow-x: hidden;
}

/* 古风背景装饰 */
.chinese-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(216, 200, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 214, 232, 0.1) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30,5 Q40,15 25,25 Q35,35 20,45 Q30,50 30,30' fill='none' stroke='%23d8c8ff' stroke-width='0.2' opacity='0.05'/%3E%3C/svg%3E");
    z-index: -2;
    pointer-events: none;
}

/* 主容器 - 更圆润娇小 */
.main-container {
    width: 100%;
    max-width: 900px;
    height: 82vh;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 244, 255, 0.95) 100%);
    border-radius: var(--border-radius);
    box-shadow: 
        var(--shadow),
        inset 0 2px 8px rgba(255, 255, 255, 0.8),
        inset 0 -2px 8px rgba(230, 220, 255, 0.3);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1.5px solid rgba(245, 238, 255, 0.8);
    position: relative;
}


/*.sidebar {*/
/*    width: 260px;*/
/*    background: linear-gradient(160deg, rgba(248, 244, 255, 0.95) 0%, rgba(232, 223, 255, 0.9) 100%);*/
/*    padding: 20px;*/
/*    border-right: 1px solid rgba(232, 223, 255, 0.6);*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    position: relative;*/
/*    overflow: hidden;*/
/*}*/
/* 用户信息区域优化 */
.user-card {
    text-align: center;
    padding: 15px 0 20px 0;
    margin-bottom: 15px;
    position: relative;
}

.user-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--pink-accent), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 4px 15px rgba(197, 177, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.user-name {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 4px;
    font-weight: 500;
}

.user-tag {
    font-size: 12px;
    color: var(--accent-color);
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: rgba(216, 200, 255, 0.2);
}

/* 功能区域优化 */
.function-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.function-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(232, 223, 255, 0.5);
    border-radius: var(--border-radius-small);
    padding: 15px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.function-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
}

.card-title {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title::before {
    content: '❀';
    font-size: 12px;
    color: var(--accent-color);
}

/* 聊天区域优化 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(252, 250, 255, 0.9) 0%, rgba(248, 244, 255, 0.95) 100%);
}

.chat-header {
    padding: 18px 25px;
    background: linear-gradient(90deg, rgba(245, 238, 255, 0.9), rgba(232, 223, 255, 0.8));
    border-bottom: 1px solid rgba(232, 223, 255, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-size: 18px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-color);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #a8e6a8;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* 消息区域优化 */
.messages-container {
    flex: 1;
    padding: 20px 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

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

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.user-avatar-small {
    background: linear-gradient(135deg, var(--pink-accent), #d4a8ff);
    color: white;
    box-shadow: 0 3px 10px rgba(197, 177, 255, 0.3);
}

.ai-avatar-small {
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    color: white;
    box-shadow: 0 3px 10px rgba(197, 177, 255, 0.3);
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 20px;
    line-height: 1.4;
    font-size: 14px;
    position: relative;
    word-wrap: break-word;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #e8c3ff);
    color: #7a5b8a;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(255, 214, 232, 0.3);
}

.ai-message .message-bubble {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(232, 223, 255, 0.6);
    color: var(--text-dark);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(197, 177, 255, 0.1);
}

.message-time {
    font-size: 10px;
    color: var(--text-color);
    opacity: 0.5;
    margin-top: 4px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* 输入区域优化 */
.input-area {
    padding: 15px 25px;
    background: linear-gradient(0deg, rgba(245, 238, 255, 0.7), transparent);
    border-top: 1px solid rgba(232, 223, 255, 0.5);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 100px;
    padding: 10px 16px;
    border: 1.5px solid rgba(232, 223, 255, 0.6);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    resize: none;
    font-size: 14px;
    transition: var(--transition);
    line-height: 1.4;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(216, 200, 255, 0.2);
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(197, 177, 255, 0.3);
}

.send-btn:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 5px 15px rgba(197, 177, 255, 0.4);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(232, 223, 255, 0.3);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-color), var(--dark-purple));
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-purple);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: 90vh;
        max-width: 100%;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 35vh;
    }
    
    body {
        padding: 10px;
    }
}

/* 花瓣飘落动画 */
.petal {
    position: fixed;
    width: 15px;
    height: 15px;
    background: rgba(216, 200, 255, 0.6);
    border-radius: 50% 0 50% 50%;
    transform: rotate(45deg);
    z-index: -1;
    animation: petalFall linear infinite;
    pointer-events: none;
}

@keyframes petalFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 古风装饰边框 */
.decorative-border {
    position: absolute;
    pointer-events: none;
}

.decorative-border.top {
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.decorative-border.bottom {
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}


/* 消息气泡文字方向调整 - 确保所有文字横向显示 */
.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(230, 212, 247, 0.5);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    line-height: 1.5;
    direction: ltr; /* 确保文字从左到右横向显示 */
    writing-mode: horizontal-tb; /* 强制横向排版 */
    text-orientation: mixed; /* 混合方向，确保所有字符横向 */
    unicode-bidi: plaintext; /* 纯文本方向 */
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #ffc2e0);
    border-color: rgba(255, 182, 217, 0.3);
    color: #8a4b6e;
    border-bottom-right-radius: 5px;
    direction: ltr; /* 用户消息也确保横向 */
    writing-mode: horizontal-tb;
}

.ai-message .message-bubble {
    border-bottom-left-radius: 5px;
    direction: ltr; /* AI消息确保横向 */
    writing-mode: horizontal-tb;
}

/* 复制文本的样式也确保横向 */
.message-bubble * {
    direction: ltr !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

/* 确保所有文本内容都是横向排列 */
.message-bubble,
.message-bubble p,
.message-bubble span,
.message-bubble div {
    direction: ltr;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    unicode-bidi: plaintext;
}

/* 用户消息内容 */
.user-message .message-content {
    order: 1;
    direction: ltr;
}

/* AI消息内容 */
.ai-message .message-content {
    order: 2;
    direction: ltr;
}

/* 消息时间戳也保持横向 */
.message-time {
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 5px;
    direction: ltr;
    writing-mode: horizontal-tb;
}

.user-message .message-time {
    text-align: left;
    direction: ltr;
}

.ai-message .message-time {
    text-align: right;
    direction: ltr;
}

/* 确保输入框文本也是横向 */
.chat-input {
    direction: ltr;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

/* 侧边栏文本方向 */
.sidebar,
.sidebar * {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 表单元素文本方向 */
.form-input, 
.form-select, 
.form-label {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 按钮文本方向 */
.btn {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 模态框文本方向 */
.modal-content,
.modal-content * {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 确保所有文本节点都是横向显示 */
body {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 占卜卡片文本 */
.fortune-content {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 对话列表文本 */
.conv-item {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 欢迎消息文本 */
.welcome-message {
    direction: ltr;
    writing-mode: horizontal-tb;
}










/* 消息气泡文字方向调整 - 确保所有文字横向显示 */
.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(230, 212, 247, 0.5);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    line-height: 1.5;
    direction: ltr; /* 确保文字从左到右横向显示 */
    writing-mode: horizontal-tb; /* 强制横向排版 */
    text-orientation: mixed; /* 混合方向，确保所有字符横向 */
    unicode-bidi: plaintext; /* 纯文本方向 */
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #ffc2e0);
    border-color: rgba(255, 182, 217, 0.3);
    color: #8a4b6e;
    border-bottom-right-radius: 5px;
    direction: ltr; /* 用户消息也确保横向 */
    writing-mode: horizontal-tb;
}

.ai-message .message-bubble {
    border-bottom-left-radius: 5px;
    direction: ltr; /* AI消息确保横向 */
    writing-mode: horizontal-tb;
}

/* 复制文本的样式也确保横向 */
.message-bubble * {
    direction: ltr !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

/* 确保所有文本内容都是横向排列 */
.message-bubble,
.message-bubble p,
.message-bubble span,
.message-bubble div {
    direction: ltr;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    unicode-bidi: plaintext;
}

/* 用户消息内容 */
.user-message .message-content {
    order: 1;
    direction: ltr;
}

/* AI消息内容 */
.ai-message .message-content {
    order: 2;
    direction: ltr;
}

/* 消息时间戳也保持横向 */
.message-time {
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 5px;
    direction: ltr;
    writing-mode: horizontal-tb;
}

.user-message .message-time {
    text-align: left;
    direction: ltr;
}

.ai-message .message-time {
    text-align: right;
    direction: ltr;
}

/* 确保输入框文本也是横向 */
.chat-input {
    direction: ltr;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

/* 侧边栏文本方向 */
.sidebar,
.sidebar * {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 表单元素文本方向 */
.form-input, 
.form-select, 
.form-label {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 按钮文本方向 */
.btn {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 模态框文本方向 */
.modal-content,
.modal-content * {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 确保所有文本节点都是横向显示 */
body {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 占卜卡片文本 */
.fortune-content {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 对话列表文本 */
.conv-item {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 欢迎消息文本 */
.welcome-message {
    direction: ltr;
    writing-mode: horizontal-tb;
}

.welcome-title,
.welcome-subtitle {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 聊天标题和状态 */
.chat-title,
.chat-status {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 确保所有伪元素也是横向 */
::before,
::after {
    direction: ltr;
    writing-mode: horizontal-tb;
}

/* 滚动条文本（如果有） */
::-webkit-scrollbar-thumb {
    direction: ltr;
}

/* 响应式设计中的文本方向 */
@media (max-width: 900px) {
    .message-content {
        max-width: 85%;
        direction: ltr;
        writing-mode: horizontal-tb;
    }
    
    .sidebar,
    .chat-container {
        direction: ltr;
        writing-mode: horizontal-tb;
    }
}

@media (max-width: 768px) {
    .main-container {
        direction: ltr;
        writing-mode: horizontal-tb;
    }
    
    body {
        direction: ltr;
        writing-mode: horizontal-tb;
    }
}

/* 打字指示器 */
.typing-indicator {
    direction: ltr;
    writing-mode: horizontal-tb;
}

.typing-dot {
    direction: ltr;
}

/* 花瓣动画相关文本 */
.petal {
    direction: ltr;
}

/* 确保所有文本内容都不会变成垂直排列 */
* {
    text-orientation: mixed;
    writing-mode: horizontal-tb;
    direction: ltr;
}

/* 特别处理可能包含特殊字符的情况 */
.message-bubble:contains("*"),
.message-bubble:contains("|"),
.message-bubble:contains(">") {
    unicode-bidi: plaintext;
    text-orientation: mixed;
}

/* 确保复制粘贴的文本也是横向 */
.message-bubble::selection {
    direction: ltr;
    writing-mode: horizontal-tb;
}








        .message {
            display: flex;
            gap: 12px;
            animation: fadeIn 0.3s ease-out;
        }
        .message-content {
            max-width: 70%;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .message-bubble {
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 15px;
            line-height: 1.5;
            word-wrap: break-word;
            overflow-wrap: break-word;
            box-shadow: 0 2px 8px rgba(147, 112, 219, 0.1);
        }
        
        .user-message .message-bubble {
            background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
            color: white;
            border-bottom-right-radius: 5px;
        }
        
        .ai-message .message-bubble {
            background: white;
            color: var(--text-color);
            border: 1px solid rgba(230, 215, 255, 0.8);
            border-bottom-left-radius: 5px;
        }
        
        .message-time {
            font-size: 12px;
            color: var(--text-color);
            opacity: 0.7;
        }
        
        
          .message-content {
                max-width: 85%;
            }.message-content {
    max-width: 70%;
}

.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(230, 212, 247, 0.5);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    line-height: 1.5;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #ffc2e0);
    border-color: rgba(230, 212, 247, 0.5);
    color: #8a4b6e;
}
.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}
.message-content {
    max-width: 70%;
    order: 1; /* 内容在左侧 */
}

.user-message .message-content {
    order: 1; /* 用户消息内容在左侧 */
}

.ai-message .message-content {
    order: 2; /* AI消息内容在右侧 */
}.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(230, 212, 247, 0.5);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    line-height: 1.5;
    position: relative;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-accent), #ffc2e0);
    border-color: rgba(255, 182, 217, 0.3);
    color: #8a4b6e;
    border-bottom-right-radius: 5px; /* 用户消息气泡右下角小圆角 */
}

.ai-message .message-bubble {
    border-bottom-left-radius: 5px; /* AI消息气泡左下角小圆角 */
}
.message-time {
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}
/* ===== 默认用户头像改为淡雅紫 ===== */
.user-avatar-small:not(:has(img)) {          /* 没有上传图片时才生效 */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;                              /* 图标保持白色 */
}

