/* DreamMaster页面的样式 */

.dream-hero-section {
    background-color: #FCFCFC;
    padding: 60px 0;
}

.dream-main-title {
    color: #6c5ce7;
    font-weight: 700;
    font-size: 2.5rem;
}

.dream-subtitle {
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* 解梦大师列表样式 */
.masters-panel {
    background-color: #f7f7f7;
    border-radius: 12px;
    padding: 20px;
    height: 650px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.panel-title {
    color: #6c5ce7;
    font-weight: 600;
    font-size: 1.5rem;
}

.masters-list {
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 自定义滚动条样式 */
.masters-list::-webkit-scrollbar {
    width: 8px;
}

.masters-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.masters-list::-webkit-scrollbar-thumb {
    background: #d4c5ff;
    border-radius: 10px;
}

.masters-list::-webkit-scrollbar-thumb:hover {
    background: #6c5ce7;
}

.master-item {
    display: flex;
    align-items: flex-start;
    background-color: #fff;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.master-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    background-color: #f8f5ff;
}

.master-item:active {
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.master-item.active {
    border-left-color: #6c5ce7;
    background-color: #f0ebff;
}

.text-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #6c5ce7;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.master-info {
    flex-grow: 1;
    overflow: hidden;
}

.master-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.master-specialty {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* 聊天界面样式 */
.chat-panel {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    height: 650px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.chat-history {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 100px;
    max-height: calc(100% - 70px);
}

/* 聊天历史滚动条样式 */
.chat-history::-webkit-scrollbar {
    width: 8px;
}

.chat-history::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #d4c5ff;
    border-radius: 10px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #6c5ce7;
}

.system-message {
    padding: 15px;
    background-color: #f5f3ff;
    border-radius: 10px;
    max-width: 95%;
    align-self: center;
    margin-bottom: 5px;
}

.system-message p {
    margin: 0;
    color: #6c5ce7;
    font-weight: 500;
}

.user-message {
    padding: 12px 15px;
    background-color: #f8f9fa;
   
    border-radius: 0 15px 15px 15px;
    width: auto; /* 改为自适应宽度，不再使用固定宽度 */
    min-width: 600px;
    max-width: 85%;
    align-self: flex-end;
}

.user-message p {
    margin: 0;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.master-message {
    display: flex;
    align-items: flex-start;
    max-width: 95%;
    align-self: flex-start;
}

.message-content {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid #efefef;
    border-radius: 0 15px 15px 15px;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 200px;
    width: auto;
    max-width: 100%;
    transition: height 0.1s ease-out;
}

.message-content p {
    margin: 0;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-input-container {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    background-color: #f8f7fe;
    border-radius: 20px;
    padding: 5px 15px;
    border: 1px solid #e1dbff;
    flex-shrink: 0;
}

.chat-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    resize: none;
    max-height: 100px;
    min-height: 24px;
    font-size: 0.95rem;
    padding-right: 50px;
    padding-left: 10px;
}

.chat-input:focus {
    outline: none;
}

.chat-send-btn {
    background: none;
    border: none;
    color: #6c5ce7;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0 0 10px;
    display: flex;
    align-items: center;
}

    .chat-send-btn:hover {
        color: #d8d8dc;
    }

/* 分类样式 */
.dream-categories {
    background-color: #FCFCFC;
}

.section-title {
    color: #6c5ce7;
    font-weight: 700;
}

.category-card {
    background-color: #fff;
    border-radius: 10px;
    text-align: center;
    padding: 20px 10px;
    height: 100%;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.category-icon {
    font-size: 2rem;
    color: #6c5ce7;
    margin-bottom: 10px;
}

.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .masters-panel, .chat-panel {
        height: 400px;
    }
}

/* 聊天流式响应和打字机效果 */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 15px;
    background-color: #333;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

/* 新增加载指示器样式 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator {
    display: flex;
    align-items: center;
    color: #6c5ce7;
}

.loading-text {
    margin-right: 10px;
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(108, 92, 231, 0.3);
    border-radius: 50%;
    border-top-color: #6c5ce7;
    animation: spin 1s linear infinite;
}