/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f4f1ea;
    color: #333;
    margin: 0;
    padding: 0;
}

.main-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #2c2c2c;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-sizing: border-box;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #444;
}

.new-chat-btn {
    background: transparent;
    border: 1px solid #555;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.new-chat-btn:hover {
    background: #444;
}

.history-list {
    flex: 1;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 5px;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.3s;
}

.history-item:hover {
    background: #3d3d3d;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f4f1ea;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.main-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.main-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    outline: none;
}

.main-input:focus {
    border-color: #8b0000;
}

.send-btn {
    padding: 12px 30px;
    background: #8b0000;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.send-btn:hover {
    background: #a00000;
}

.disclaimer {
    text-align: center;
    font-size: 0.8em;
    color: #999;
    margin-top: 10px;
}

h1 {
    text-align: center;
    color: #8b0000;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #8b0000;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background-color: #a52a2a;
}

/* 聊天对话样式 */
.chat-msg {
    margin-bottom: 15px;
    line-height: 1.6;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 85%;
}

.taoist-msg {
    background-color: #fdf5e6;
    border-left: 4px solid #8b0000;
    align-self: flex-start;
    color: #4a4a4a;
}

.user-msg {
    background-color: #e1f5fe;
    border-right: 4px solid #0288d1;
    align-self: flex-end;
    margin-left: auto;
    text-align: left; /* 改为左对齐，阅读更自然 */
}

#chatHistory {
    display: flex;
    flex-direction: column;
}

.taoist-name {
    font-weight: bold;
    color: #8b0000;
    margin-bottom: 5px;
    display: block;
}

.user-name {
    font-weight: bold;
    color: #0288d1;
    margin-bottom: 5px;
    display: block;
}

.loading {
    text-align: center;
    display: none;
}
