/* CSS变量定义 */
:root {
    --base-font-size: 16px;
    --primary-color: #a83232;
    --secondary-color: #c44545;
    --background-color: #fff5f5;
    --text-color: #5a2a2a;
    --border-color: #ffcccc;
}

/* 深色主题变量 */
body.dark-theme {
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #444;
}

/* 深色主题下的标题保持原色 */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
    color: #5a2a2a; /* 保持原来的深红色 */
}

/* 深色主题下的导航标题保持原色 */
body.dark-theme header h1 {
    color: #ffd6d6; /* 保持原来的浅粉色 */
}

/* 深色主题下的section标题保持原色 */
body.dark-theme section h2 {
    color: #5a2a2a; /* 保持原来的深红色 */
}

/* 深色主题下的单词标题保持原色 */
body.dark-theme .word-title {
    color: #8a2a2a; /* 保持原来的深红色 */
}

/* 深色主题下的评论标题保持原色 */
body.dark-theme #comment-title {
    color: #8a2a2a; /* 保持原来的深红色 */
}

/* 深色主题下的交互框字体保持原色 */
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme button,
body.dark-theme select {
    color: #333; /* 保持原来的深色字体 */
}

/* 深色主题下的搜索框保持原色 */
body.dark-theme #search-input {
    color: #333;
}

/* 深色主题下的聊天输入框保持原色 */
body.dark-theme #chat-input {
    color: #333;
}

/* 深色主题下的评论输入框保持原色 */
body.dark-theme #comment-input {
    color: #333;
}

/* 深色主题下的按钮文字保持原色 */
body.dark-theme button {
    color: #333;
}

/* 深色主题下的下拉菜单选项保持原色 */
body.dark-theme option {
    color: #333;
}

/* 深色主题下的占位符文字保持原色 */
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #999;
}



/* 深色主题下的收藏夹弹窗标题保持原色 */
body.dark-theme .modal h2,
body.dark-theme .modal-title {
    color: #8a2a2a; /* 保持原来的深红色 */
}

/* 深色主题下的搜词义页面所有文字保持原色 */
body.dark-theme #guess-section,
body.dark-theme #guess-section *,
body.dark-theme .search-container,
body.dark-theme .search-container *,
body.dark-theme .search-history,
body.dark-theme .search-history * {
    color: #333 !important; /* 保持原来的深色，使用!important覆盖全局变量 */
}

/* 深色主题下的搜词义结果强制保持原色 */
body.dark-theme #word-result,
body.dark-theme #word-result p,
body.dark-theme #word-result div,
body.dark-theme #word-result *,
body.dark-theme .word-meaning,
body.dark-theme .result-container,
body.dark-theme .result-container * {
    color: #333 !important; /* 使用!important确保覆盖 */
}

/* 深色主题下的收藏夹按钮文字强制保持原色 */
body.dark-theme #favorites-btn {
    color: #333 !important; /* 使用!important确保覆盖 */
}

/* 深色主题下的弹窗内容强制保持原色 */
body.dark-theme .favorites-modal,
body.dark-theme .favorites-modal *,
body.dark-theme .favorites-modal-content,
body.dark-theme .favorites-modal-content *,
body.dark-theme .favorites-modal-header,
body.dark-theme .favorites-modal-header *,
body.dark-theme .favorites-list,
body.dark-theme .favorites-list * {
    color: #333 !important; /* 使用!important确保覆盖 */
}

/* 深色主题下的收藏列表项强制保持原色 */
body.dark-theme .favorite-item {
    color: #333 !important; /* 使用!important确保覆盖 */
}

/* 深色主题下的搜词义页面标题保持原色 */
body.dark-theme #search-section h2,
body.dark-theme #search-section h3 {
    color: #5a2a2a; /* 保持原来的深红色 */
}



/* 通用样式 */
body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--background-color);
    font-size: var(--base-font-size);
    transition: all 0.3s ease;
}

/* 侧边图片样式 */
.side-image {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 18%; /* 根据图片尺寸调整 */
    z-index: -1; /* 确保在内容层下方 */
    opacity: 1.0; /* 适当透明度 */
    transition: all 0.3s ease;
    overflow: hidden; /* 确保放大图片不会溢出 */
    cursor: pointer; /* 添加指针样式提示可交互 */
}

.side-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.left-image {
    left: 0;
    padding-left: 10px;
    /* 增加左侧悬停检测区域 */
    padding-right: 5px;
}

.right-image {
    right: 0;
    padding-right: 10px;
    /* 增加右侧悬停检测区域 */
    padding-left: 5px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .side-image {
        width: 12%;
        opacity: 0.5;
    }
    main {
        margin: 0 15%;
    }
}

@media (max-width: 768px) {
    .side-image {
        display: none; /* 小屏幕隐藏侧边图 */
    }
    main {
        margin: 0 10px;
    }
}

.left-image img {
    animation: float-vertical 6s ease-in-out infinite;
}
.right-image img {
    animation: float-horizontal 5s ease-in-out infinite;
}

@keyframes float-vertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes float-horizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

header {
    background-color: var(--primary-color);
    color: #ffd6d6;
    padding: 1rem 0;
    text-align: center;
    position: relative;
}

.header-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.header-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffd6d6;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.header-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.font-size-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 1000;
}

.font-size-menu.show {
    display: flex;
}

.font-size-menu button {
    background: var(--primary-color);
    color: #ffd6d6;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.9rem;
}

.font-size-menu button:hover {
    background: var(--secondary-color);
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    margin: 1rem 0 0;
}

nav li {
    margin: 0 1rem;
}

nav a {
    color: #ffd6d6;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

nav a:hover {
    background-color: #8a2a2a; /* 更深的红色 */
    transform: translateY(1px);
}

/* 当前页面高亮效果 */
nav a.active {
    background-color: #6b1f1f; /* 更深的红色作为当前页面标识 */
    box-shadow: 0 0 10px rgba(139, 31, 31, 0.5); /* 添加阴影效果 */
    border: 2px solid #ffd6d6; /* 添加边框 */
    transform: scale(1.05);
}

/* 移除光影效果 */

/* 添加悬停放大效果 */
.side-image:hover {
    width: 22%; /* 悬停时稍微放大 */
    z-index: 10; /* 确保放大时在最上层 */
    opacity: 1; /* 确保悬停时完全不透明 */
}

/* 图片放大动画 */
.side-image:hover img {
    transform: scale(1.15); /* 更自然的放大效果 */
}

/* 增加悬停检测的灵敏度 */
.side-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5; /* 确保在图片之上但在悬停效果之下 */
    pointer-events: auto; /* 确保可以接收鼠标事件 */
}

/* 优化悬停状态的视觉反馈 */
.side-image:hover::before {
    background: transparent; /* 移除白膜效果 */
}

main {
    margin: 0 20%; /* 与侧边图片宽度匹配 */
    max-width: 1000px;
    padding: 0 1rem;
    transition: margin 0.3s ease; /* 添加过渡效果 */
}

/* 移除图片悬停时的主内容边距调整 */

/* 右边图片悬停效果 */
.right-image:hover {
    width: 22%; /* 悬停时稍微放大 */
    z-index: 10; /* 确保放大时在最上层 */
    opacity: 1; /* 确保悬停时完全不透明 */
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .side-image {
        width: 15%;
        opacity: 0.8;
    }

    .side-image:hover {
        width: 18%;
    }

    main {
        margin: 0 17%;
    }

    /* 移除响应式设计中的图片悬停边距调整 */
}

@media (max-width: 768px) {
    .side-image {
        display: none;
    }

    main {
        margin: 0 10px;
    }
}

section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(168, 50, 50, 0.1); /* 红色阴影 */
    padding: 2rem;
    margin-bottom: 2rem;
    display: none;
    border: 1px solid #ffcccc; /* 浅红色边框 */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

section.active-section {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

footer {
    position: fixed;      /* 固定定位 */
    bottom: 0;            /* 固定在底部 */
    left: 0;              /* 从左侧开始 */
    right: 0;             /* 延伸到右侧 */
    text-align: center;
    padding: 1rem;
    background-color: #a83232; /* 深红色 */
    color: #ffd6d6;
    z-index: 100;         /* 确保在其他内容之上 */
    margin: 0;            /* 移除默认边距 */
}

/* 搜词义部分 */
.search-container {
    display: flex;
    margin-bottom: 1.5rem;
    animation: slideInUp 0.6s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#word-input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#word-input:focus {
    outline: none;
    border-color: #c44545;
    box-shadow: 0 0 0 3px rgba(196, 69, 69, 0.1);
    transform: scale(1.02);
}

#search-btn {
    padding: 0 1.5rem;
    background-color: #c44545; /* 红色按钮 */
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#search-btn:hover {
    background-color: #a83232; /* 深红色悬停 */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(168, 50, 50, 0.3);
}

#search-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(168, 50, 50, 0.3);
}

.search-history {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: none;
}

.search-history.show {
    display: block;
}

.history-item {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: #ffd6d6;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.result-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    min-height: 200px;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.word-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.favorited {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.word-header.favorited {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(255, 105, 180, 0.1));
    border-radius: 8px;
    padding: 1rem;
    margin: -1rem;
    border: 2px solid rgba(255, 105, 180, 0.3);
}

/* 收藏夹按钮 */
.favorites-toggle-btn {
    background: var(--primary-color);
    color: #ffd6d6;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.favorites-toggle-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(168, 50, 50, 0.3);
}

/* 收藏夹弹窗 */
.favorites-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.favorites-modal.show {
    display: flex;
}

.favorites-modal-content {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.favorites-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.favorites-modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-favorites {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-favorites:hover {
    color: var(--primary-color);
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.favorite-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

.favorite-item span {
    font-weight: 500;
    color: var(--text-color);
}

.favorite-item button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #999;
    transition: color 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.favorite-item button:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.word-title {
    font-size: 1.8rem;
    margin: 0;
    color: #8a2a2a;
}

.phonetic {
    color: #7f8c8d;
    font-style: italic;
    margin: 0.5rem 0;
}

.part-of-speech {
    font-weight: bold;
    color: #c44545;
    margin: 1rem 0 0.5rem;
}

.definition {
    margin-bottom: 0.5rem;
}

.example {
    color: #7f8c8d;
    font-style: italic;
    margin-left: 1rem;
    border-left: 2px solid #ddd;
    padding-left: 1rem;
}

/* 阅读部分 */
.comment-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#comment-selector {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 16px;

    transition: all 0.5s ease;
}

#comment-selector:hover {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52,152,219,0.3);
}

#prev-btn, #next-btn {
    padding: 0.5rem 1rem;
    background-color: #c44545; /* 红色按钮 */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#prev-btn:hover, #next-btn:hover {
    background-color: #a83232; /* 深红色悬停 */
}

/* 加载状态样式 */
#comment-content p.loading {
    color: #3498db;
    font-style: italic;
}

/* 评论内容样式 */
#comment-content {
    font-size: 19px;
    line-height: 2;
    font-family: "Noto Serif SC", "SimSun", serif;
    text-align: justify;
    text-indent: 2em;
    color: #333;
    padding: 25px;
    background-color: #fff9f9; /* 非常浅的红色背景 */
    border-left: 3px solid #d4a3a3; /* 浅棕色边框 */

    letter-spacing: 0.05em; /* 字间距微调 */
    word-spacing: 0.1em;   /* 词间距微调 */
    animation: contentFadeIn 0.8s ease;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 段落样式 */
#comment-content p {
    margin-bottom: 1.5em; /* 增加段落间距 */
}

/* 评论标题样式 */
#comment-title {
    font-family: "STKaiti", cursive;
    font-size: 28px;
    text-align: center;
    margin: 20px 0;
    color: #8a2a2a; /* 深红色标题 */
    letter-spacing: 2px;
}

/* 外语内容特殊样式 */
.foreign-text {
    font-style: italic;
    color: #7a6a5f;
    padding: 0 3px;
    background-color: #f0e6d2;
}

/* 小说风格的阅读区域 */
#read-section {
    background-color: #fff5f5; /* 浅红色背景 */
    border: 1px solid #ffcccc;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 段落样式 */
.comment-paragraph {
    margin-bottom: 30px;
}

/* 页码样式 */
.page-number {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.hint-text {
    text-align: center;
    color: #888;
    font-style: italic;
    margin-top: 50px;
    font-size: 16px;
}

/* 无内容提示 */
.no-content {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* 添加错误提示样式 */
.error {
    color: #e74c3c;
    font-weight: bold;
}

.error-detail {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.word-highlight {
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.word-highlight:hover {
    color: #2980b9;
}

/* 弹出窗口样式 */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px); /* 减去footer高度 */
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    margin-bottom: 60px; /* 为footer留出空间 */
}

.popup-content {
    background-color: #fff9f9;
    border: 1px solid #ffcccc;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    margin-bottom: 60px; /* 确保内容不被footer遮挡 */
    max-height: calc(100vh - 180px); /* 限制最大高度 */
    overflow-y: auto; /* 允许内容滚动 */
}

.close-popup {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close-popup:hover {
    color: #333;
}

#popup-word {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
    }

    #word-input {
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }

    #search-btn {
        border-radius: 4px;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav li {
        margin: 0.5rem 0;
    }
}

/* 聊天部分样式 */
#chat-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    display: none;
}

#chat-section.active-section {
    display: block;
}

#chat-section.active-section {
    display: block;
}

/* 移除旧的聊天侧边栏样式 */

#chat-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    height: 500px; /* 增加高度 */
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.6s ease;
    flex: 1;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.chat-message {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: messageSlideIn 0.4s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background-color: #ffebee; /* 浅红色背景 */
    color: #5a2a2a;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-message {
    white-space: pre-line; /* 保留换行但合并多余空格 */
    line-height: 1.5;
    padding: 10px 15px;
    background-color: #fce4ec; /* 粉色背景 */
    color: #5a2a2a;
    border-radius: 5px;
    margin: 5px 0;
}

.chat-input-container {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
}

#chat-input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#chat-input:focus {
    outline: none;
    border-color: #c44545;
    box-shadow: 0 0 0 3px rgba(196, 69, 69, 0.1);
    transform: scale(1.02);
}

#send-btn {
    padding: 0 1.5rem;
    background-color: #c44545; /* 红色按钮 */
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#send-btn:hover {
    background-color: #a83232; /* 深红色悬停 */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(168, 50, 50, 0.3);
}

#send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(168, 50, 50, 0.3);
}

.loading-dots {
    display: inline-block;
    margin-left: 0.5rem;
}

.loading-dots::after {
    color: #c44545;
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* 添加音乐面板样式 */
#music-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 30%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1001; /* 确保在最上层 */
    overflow-y: auto;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid #ddd;
}

#music-panel.show {
    transform: translateX(0);
}

.music-item {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #fff5f5;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: musicItemSlideIn 0.5s ease;
    animation-fill-mode: both;
}

.music-item:nth-child(1) { animation-delay: 0.1s; }
.music-item:nth-child(2) { animation-delay: 0.2s; }
.music-item:nth-child(3) { animation-delay: 0.3s; }
.music-item:nth-child(4) { animation-delay: 0.4s; }
.music-item:nth-child(5) { animation-delay: 0.5s; }
.music-item:nth-child(6) { animation-delay: 0.6s; }
.music-item:nth-child(7) { animation-delay: 0.7s; }

@keyframes musicItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.music-item h4 {
    margin-top: 0;
    color: #8a2a2a;
}

.music-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.music-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#close-music {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
}

#close-music:hover {
    color: #333;
}

.music-controls {
    margin-bottom: 20px;
}

#pause-btn {
    background-color: #f44336;
}

#pause-btn:hover {
    background-color: #d32f2f;
}

.music-display {
    margin-top: 20px;
}

#music-image {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 添加遮罩层 */
#music-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    main {
        margin-bottom: 5rem; /* 移动设备上增加更多底部空间 */
    }

    #music-panel {
        width: 85%;
        height: calc(100vh - 70px); /* 移动设备上调整高度 */
    }

    footer {
        padding: 0.8rem; /* 移动设备上减小内边距 */
    }
}