* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f2f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
    margin: 0;
    overflow: hidden;
    position: relative;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.sidebar {
    width: 260px;
    background-color: #2d3748;
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: transform 0.3s ease, width 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Collapsed sidebar styles */
.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Add margin to chat container when sidebar is visible */
.chat-container {
    margin-left: 0;
    transition: margin-left 0.3s ease, width 0.3s ease;
    width: 100%;
}

/* When sidebar is visible, adjust chat container */
.sidebar:not(.collapsed) ~ .chat-container {
    margin-left: 260px;
    width: calc(100% - 260px);
}

/* Sidebar toggle button styles */
.sidebar-toggle-button {
    position: fixed;
    left: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #b2c5db;
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.sidebar-toggle-button:hover {
    background-color: #3a5a78;
    transform: scale(1.05);
}

.sidebar-toggle-button:active {
    transform: scale(0.95);
}

.sidebar-icon {
    font-size: 24px;
    line-height: 1;
    color: white;
}

/* Rundown toggle button styles */
.rundown-toggle-button {
    position: fixed;
    left: 70px;
    top: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #b2c5db;
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.rundown-toggle-button:hover {
    background-color: #3a5a78;
    transform: scale(1.05);
}

.rundown-toggle-button:active {
    transform: scale(0.95);
}

.rundown-icon {
    font-size: 24px;
    line-height: 1;
    color: white;
}

/* Schedule Chapter toggle button styles */
.schedule-chapter-toggle-button {
    position: fixed;
    left: 125px;
    top: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #b2c5db;
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.schedule-chapter-toggle-button:hover {
    background-color: #3a5a78;
    transform: scale(1.05);
}

.schedule-chapter-toggle-button:active {
    transform: scale(0.95);
}

.schedule-chapter-icon {
    font-size: 24px;
    line-height: 1;
    color: white;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
    color: #e2e8f0;
    text-align: center;
}

.chat-list {
    flex: 0.5;
    overflow-y: auto;
    padding: 10px;
    min-height: 100px;
}

/* Sidebar divider styles */
.sidebar-divider {
    height: 10px;
    background-color: #3a5a78;
    cursor: ns-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.divider-handle {
    width: 30px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Agent list container styles */
.agent-list-container {
    flex: 0.5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 100px;
}

.agent-list-header {
    font-size: 1rem;
    color: #e2e8f0;
    margin: 10px 0;
    padding: 0 10px;
    font-weight: 600;
}

.agent-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 10px 10px;
}

.agent-item {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
}

.agent-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.agent-item.active {
    background-color: rgba(74, 118, 168, 0.5);
}

.agent-item-icon {
    margin-right: 10px;
    font-size: 1.1rem;
    color: #a0aec0;
}

.agent-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-agent-button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.agent-item:hover .delete-agent-button {
    opacity: 1;
}

.delete-agent-button:hover {
    color: #e53e3e;
}

.add-agent-button {
    margin: 10px;
    padding: 8px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-agent-button:hover {
    background-color: #3a5a78;
    transform: translateY(-1px);
}

.add-agent-button:active {
    transform: scale(0.98);
}

.add-agent-button i {
    margin-right: 8px;
    font-size: 1.2rem;
    color: white;
}

/* Agent form modal styles */
.agent-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.agent-form-modal.visible {
    opacity: 1;
    visibility: visible;
}

.agent-form-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.agent-form-modal.visible .agent-form-container {
    transform: translateY(0);
}

.agent-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.agent-form-header h3 {
    font-size: 1.2rem;
    color: #2d3748;
    margin: 0;
}

.agent-form-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.agent-form-close:hover {
    color: #e53e3e;
}

.agent-form-group {
    margin-bottom: 15px;
}

.agent-form-group label {
    display: block;
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 5px;
    font-weight: 500;
}

.agent-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.agent-form-group input:focus {
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.2);
    outline: none;
}

.agent-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.agent-form-cancel {
    padding: 8px 16px;
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.agent-form-cancel:hover {
    background-color: #cbd5e0;
}

.agent-form-submit {
    padding: 8px 16px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.agent-form-submit:hover {
    background-color: #3a5a78;
}

.chat-item {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    position: relative;
}

.chat-item-icon {
    margin-right: 10px;
}

.delete-chat-button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.chat-item:hover .delete-chat-button {
    opacity: 1;
}

.delete-chat-button:hover {
    color: #e53e3e;
}

.chat-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-item.active {
    background-color: rgba(74, 118, 168, 0.5);
}

.chat-item-icon {
    margin-right: 10px;
    font-size: 1.1rem;
    color: #a0aec0;
    display: flex;
    align-items: center;
    vertical-align: middle;
}

.material-icons.chat-item-icon {
    font-size: 1.1rem;
    color: #a0aec0;
}

.material-symbols-outlined.chat-item-icon {
    font-size: 1.2rem;
}

.chat-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 0.7rem;
    color: #a0aec0;
    margin-left: 5px;
}

.new-chat-button-container {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#new-chat-button {
    width: 100%;
    padding: 10px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#new-chat-button:hover {
    background-color: #3a5a78;
    transform: translateY(-1px);
}

#new-chat-button:active {
    transform: scale(0.98);
}

.plus-icon {
    margin-right: 8px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.material-icons.plus-icon {
    font-size: 1.2rem;
    color: white;
    display: inline-block;
    vertical-align: middle;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: white;
    overflow: hidden;
    position: relative;
    margin-right: 0; /* 默認為0 */
    transition: margin-right 0.3s ease, margin-left 0.3s ease, width 0.3s ease; /* 添加過渡效果，包括左側邊欄的過渡 */
}

/* 當右側面板展開時，調整chat-container的寬度和右邊距 */
.quick-select-container:not(.collapsed) ~ .chat-container {
    margin-right: 260px;
    width: calc(100% - 260px);
}

/* 確保右側面板展開時，聊天輸入容器不會移動 */
.chat-container .chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    z-index: 5;
    padding: 18px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 當左側欄展開時，調整聊天輸入容器的位置和寬度 */
.sidebar:not(.collapsed) ~ .chat-container .chat-input-container {
    left: 260px;
    width: calc(100% - 260px); /* 調整寬度以適應左側欄 */
}

/* 當右側欄展開時，調整聊天輸入容器的位置 */
.quick-select-container:not(.collapsed) ~ .chat-container .chat-input-container {
    right: 260px;
}

/* 為聊天消息容器添加底部間距，避免被固定的輸入框遮擋 */
.chat-messages {
    padding-bottom: 90px;
}

/* 確保sidebar展開時，內部元素也能正確調整 */
.sidebar:not(.collapsed) ~ .chat-container .chat-messages,
.sidebar:not(.collapsed) ~ .chat-container .chat-header,
.sidebar:not(.collapsed) ~ .chat-container .chat-input-container {
    width: 100%;
}

/* 當左側和右側面板同時展開時的處理 */
.sidebar:not(.collapsed) ~ .chat-container.quick-select-container:not(.collapsed) {
    margin-left: 260px;
    margin-right: 260px;
    width: calc(100% - 520px);
}

/* 當左側和右側面板同時展開時，調整聊天輸入容器的位置和寬度 */
.sidebar:not(.collapsed) ~ .chat-container .quick-select-container:not(.collapsed) ~ .chat-input-container {
    left: 260px;
    right: 260px;
    width: calc(100% - 520px);
}

/* 確保在小屏幕上，當一個面板展開時，另一個自動折疊 */
@media (max-width: 768px) {
    .sidebar:not(.collapsed) ~ .chat-container .quick-select-container:not(.collapsed) {
        transform: translateX(100%);
    }
    
    .quick-select-container:not(.collapsed) ~ .chat-container .sidebar:not(.collapsed) {
        transform: translateX(-100%);
    }
}

.toggle-sidebar-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 10px;
    display: none;
}

.chat-header {
    background: linear-gradient(135deg, #4a76a8 0%, #3a5a78 100%);
    color: white;
    padding: 30px 20px; /* 增加上下padding從18px到30px，讓藍色區域變大 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 70px; /* Add padding to the left to avoid overlap with the sidebar toggle button */
}

.chat-header h1 {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.current-agent-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem; /* 增加字體大小 */
    font-weight: 600;
    color: white;
    padding: 5px 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.current-agent-display .material-symbols-outlined {
    margin-right: 8px;
    font-size: 2rem; /* 增加圖標大小 */
    vertical-align: middle;
}

#clear-history-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#clear-history-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

#clear-history-button:active {
    transform: scale(0.95);
    background-color: rgba(255, 255, 255, 0.15);
}

.header-icon {
    height: 36px;
    width: auto;
    margin-right: 12px;
    vertical-align: middle;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.header-icon:hover {
    transform: scale(1.05);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 0;
    background-color: #f9fafc;
    background-image: 
        radial-gradient(circle at 25px 25px, rgba(74, 118, 168, 0.03) 2px, transparent 0),
        radial-gradient(circle at 75px 75px, rgba(74, 118, 168, 0.03) 2px, transparent 0);
    background-size: 100px 100px;
}


/* 菜單按鈕樣式 */
.menu-toggle-button {
    position: fixed;
    right: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #9ab2cc;
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 11;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.menu-toggle-button:hover {
    background-color: #3a5a78;
    transform: scale(1.05);
}

.menu-toggle-button:active {
    transform: scale(0.95);
}

.menu-dots {
    font-size: 24px;
    line-height: 1;
}

/* 快速選擇容器樣式 */
.quick-select-container {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    padding: 15px;
    background-color: #fafdff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow: auto;
    z-index: 10;
    transition: transform 0.3s ease;
}

/* 折疊狀態 */
.quick-select-container.collapsed {
    transform: translateX(100%);
}

.quick-select-section {
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 10px;
    flex: 1;
}

.quick-select-section:last-child {
    margin-bottom: 0;
    flex-grow: 1;
    flex-direction: column; /* 添加這一行 */
    overflow: hidden; 
}

.quick-select-section h3 {
    font-size: 0.9rem;
    color: #4a76a8;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    display: inline-block;
}

.quick-select-section h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #4a76a8, transparent);
    border-radius: 2px;
}

.quick-select-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Screen buttons specific styling - 3 buttons per row */
#screen-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Make screen buttons slightly smaller */
#screen-buttons .quick-select-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.quick-select-btn {
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    border-radius: 18px;
    padding: 7px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: #4a5568;
}

.quick-select-btn:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.quick-select-btn.selected {
    background: linear-gradient(135deg, #4a76a8 0%, #3a5a78 100%);
    color: white;
    border-color: #3a5a78;
    box-shadow: 0 2px 5px rgba(74, 118, 168, 0.3);
}

.stickers-container {
    display: flex;
    justify-content: space-around;
    margin-top: 8px;
    flex: 1;
    overflow: auto;
    width: 100%;
}

.sticker {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    flex-shrink: 0; /* 防止按鈕縮小 */
}

/* 只有在容器寬度不足時才縮小按鈕 */
@media (max-width: 200px) {
    .sticker {
        width: 40px;
        height: 40px;
        flex-shrink: 1;
    }
}

.sticker:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(74, 118, 168, 0.5);
}

.sticker:active {
    transform: scale(0.95);
}

.sticker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.sticker:hover img {
    filter: brightness(1.05);
}

/* Number pad styles */
.jujue-button-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.jujue-button {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 10px;
    width: 100%;
    max-width: 200px;
}

.number-btn {
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    border-radius: 8px;
    padding: 10px 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px;
}

.number-btn:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.number-btn:active {
    transform: scale(0.95);
    background-color: #d1e1f7;
}

/* Tag button styles */
.tag-button {
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.message:hover .tag-button {
    opacity: 1;
}

.tag-button:hover {
    background-color: #3a5a78;
}

/* Tag styles */
.tag-item {
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    border-radius: 18px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: #4a5568;
    margin: 2px;
    display: inline-block;
    position: relative;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-item:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Tag delete button styles */
.tag-delete-button {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background-color: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.tag-item:hover .tag-delete-button {
    opacity: 1;
}

.tag-delete-button:hover {
    transform: scale(1.1);
}

/* Tag rename input styles */
.tag-rename-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 7px 14px;
    border: 1px solid #4a76a8;
    border-radius: 18px;
    font-size: 0.85rem;
    background-color: white;
    outline: none;
    z-index: 3;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tags-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

/* Play Chapter 下拉選單容器樣式 */
.play-chapter-dropdown-container {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.play-chapter-dropdown {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d8e2f0;
    border-radius: 8px;
    background-color: #f0f5fa;
    color: #4a5568;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%234a5568' 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 8px center;
    background-size: 16px;
    padding-right: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-chapter-dropdown:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.play-chapter-dropdown:focus {
    outline: none;
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.2);
}

.play-chapter-button {
    padding: 8px 16px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.play-chapter-button:hover {
    background-color: #3a5a78;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.play-chapter-button:active {
    transform: scale(0.98);
}

/* Schedule Chapter 下拉選單容器樣式 */
.schedule-chapter-dropdown-container {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.schedule-chapter-dropdown {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d8e2f0;
    border-radius: 8px;
    background-color: #f0f5fa;
    color: #4a5568;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%234a5568' 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 8px center;
    background-size: 16px;
    padding-right: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-chapter-dropdown:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.schedule-chapter-dropdown:focus {
    outline: none;
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.2);
}

.schedule-chapter-button {
    padding: 8px 16px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.schedule-chapter-button:hover {
    background-color: #3a5a78;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.schedule-chapter-button:active {
    transform: scale(0.98);
}

.schedule-chapter-actions {
    margin-top: 8px;
}

.add-schedule-chapter-button {
    width: 100%;
    padding: 8px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-schedule-chapter-button:hover {
    background-color: #3a5a78;
    transform: translateY(-1px);
}

.add-schedule-chapter-button:active {
    transform: scale(0.98);
}

.add-schedule-chapter-button i {
    margin-right: 8px;
    font-size: 1.2rem;
    color: white;
}

.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    margin-bottom: 8px;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

/* 消息內容格式化樣式 */
.message-content {
    white-space: pre-wrap; /* 保留空格和換行 */
}

/* 程式碼區塊樣式 */
.code-block-container {
    position: relative;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #2d2d2d;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', monospace;
    border-bottom: 1px solid #3d3d3d;
}

.code-block-language {
    font-weight: 500;
}

.code-block-copy-button {
    background: none;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.code-block-copy-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.code-block-copy-button i {
    font-size: 16px;
    margin-right: 4px;
    color: inherit;
}

.code-block-content {
    padding: 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.3;
    color: #e0e0e0;
}

.code-block-content code {
    font-family: inherit;
    padding: 0;
    margin: 0;
    display: block;
}

.code-block-content pre {
    margin: 0;
    padding: 8px 12px;
}

/* 語法高亮樣式 */
.hljs {
    display: block;
    overflow-x: auto;
    padding: 0;
    background: transparent;
    color: #e0e0e0;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
    color: #569cd6;
}

.hljs-function {
    color: #dcdcaa;
}

.hljs-string,
.hljs-attr,
.hljs-regex,
.hljs-addition {
    color: #ce9178;
}

.hljs-built_in,
.hljs-name {
    color: #4ec9b0;
}

.hljs-comment,
.hljs-quote,
.hljs-meta {
    color: #6a9955;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet {
    color: #b5cea8;
}

.hljs-variable,
.hljs-template-variable {
    color: #9cdcfe;
}

.hljs-type,
.hljs-title {
    color: #4ec9b0;
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

/* 複製成功提示樣式 */
.copy-success-message {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.copy-success-message.visible {
    opacity: 1;
}

/* 列表項目樣式 */
.list-item {
    display: flex;
    margin: 4px 0;
    align-items: flex-start;
}

/* 數字列表樣式 */
.list-number {
    font-weight: 500;
    min-width: 24px;
    margin-right: 4px;
    color: #4a76a8;
}

/* 項目符號列表樣式 */
.list-bullet {
    font-weight: 500;
    min-width: 20px;
    margin-right: 4px;
    color: #4a76a8;
}

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

.user-message {
    align-self: flex-end;
    background: linear-gradient(120deg, #dcf8c6 0%, #c6f8dc 100%);
    border-bottom-right-radius: 5px;
    color: #2c5d2d;
}

.api-message {
    align-self: flex-start;
    background: linear-gradient(120deg, #e5e5ea 0%, #f0f0f5 100%);
    border-bottom-left-radius: 5px;
    color: #3a3a3c;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.4);
    margin-top: 5px;
    text-align: right;
    font-weight: 500;
}

.youtube-embed-container, .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.youtube-embed-container iframe, .video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-link {
    margin: 8px 0;
    text-align: center;
}

.video-link a, .video-file-link {
    color: #4a76a8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 15px;
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    display: inline-block;
    transition: all 0.2s ease;
}

.video-link a:hover, .video-file-link:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.playlist-link {
    color: #4a76a8;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 15px;
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    display: inline-block;
    transition: all 0.2s ease;
    margin: 5px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.playlist-link:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

/* Prompt buttons styles */
.prompt-buttons-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.03);
    width: 100%;
    transition: width 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    position: fixed;
    bottom: 84px; /* 位於聊天輸入框上方 */
    left: 0;
    right: 0;
    z-index: 5;
}

/* Hidden prompt buttons */
.prompt-buttons-container.hidden {
    opacity: 0;
    visibility: hidden;
}

/* 當左側欄展開時，調整prompt按鈕容器的位置 */
.sidebar:not(.collapsed) ~ .chat-container .prompt-buttons-container {
    left: 260px;
}

/* 當右側欄展開時，調整prompt按鈕容器的位置 */
.quick-select-container:not(.collapsed) ~ .chat-container .prompt-buttons-container {
    right: 260px;
}

.prompt-btn {
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: #4a5568;
}

.prompt-btn:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.prompt-btn:active {
    transform: scale(0.98);
    background-color: #d1e1f7;
}

/* 確保右側面板展開時，prompt按鈕容器也能正確調整 */
.chat-container .quick-select-container:not(.collapsed) ~ .prompt-buttons-container,
.chat-container .quick-select-container:not(.collapsed) ~ .voice-buttons-container {
    width: calc(100% - 260px);
}

/* Voice buttons styles */
.voice-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.voice-btn {
    background-color: #e1ebf7;
    border: 1px solid #c6d9ed;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: #3a5a78;
}

.voice-btn:hover {
    background-color: #d1e1f7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.voice-btn:active {
    transform: scale(0.98);
    background-color: #c1d1e7;
}

/* Rundown modal styles */
.rundown-modal, .schedule-chapter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rundown-modal.visible, .schedule-chapter-modal.visible {
    opacity: 1;
    visibility: visible;
}

.rundown-container, .schedule-chapter-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.rundown-modal.visible .rundown-container, 
.schedule-chapter-modal.visible .schedule-chapter-container {
    transform: translateY(0);
}

.rundown-header, .schedule-chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.rundown-header h3, .schedule-chapter-header h3 {
    font-size: 1.2rem;
    color: #2d3748;
    margin: 0;
}

.rundown-close, .schedule-chapter-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rundown-close:hover, .schedule-chapter-close:hover {
    color: #e53e3e;
}

.rundown-content, .schedule-chapter-content {
    margin-bottom: 20px;
}

.rundown-list, .schedule-chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.rundown-item, .schedule-chapter-list-item {
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rundown-item:hover, .schedule-chapter-list-item:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.rundown-item-name, .schedule-chapter-list-item-name {
    font-weight: 500;
    color: #4a5568;
}

.rundown-item-actions, .schedule-chapter-list-item-actions {
    display: flex;
    gap: 5px;
}

.rundown-item-edit, .rundown-item-delete, 
.schedule-chapter-list-item-edit, .schedule-chapter-list-item-delete {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s ease;
}

.rundown-item-edit:hover, .schedule-chapter-list-item-edit:hover {
    color: #4a76a8;
}

.rundown-item-delete:hover, .schedule-chapter-list-item-delete:hover {
    color: #e53e3e;
}

.add-rundown-button, .add-schedule-chapter-button {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-rundown-button:hover, .add-schedule-chapter-button:hover {
    background-color: #3a5a78;
    transform: translateY(-1px);
}

.add-rundown-button:active, .add-schedule-chapter-button:active {
    transform: scale(0.98);
}

.add-rundown-button i, .add-schedule-chapter-button i {
    margin-right: 8px;
    font-size: 1.2rem;
    color: white;
}

/* Rundown form modal styles */
.rundown-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rundown-form-modal.visible {
    opacity: 1;
    visibility: visible;
}

.rundown-form-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.rundown-form-modal.visible .rundown-form-container {
    transform: translateY(0);
}

.rundown-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.rundown-form-header h3 {
    font-size: 1.2rem;
    color: #2d3748;
    margin: 0;
}

.rundown-form-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rundown-form-close:hover {
    color: #e53e3e;
}

.rundown-form-content {
    margin-bottom: 20px;
}

.rundown-form-group {
    margin-bottom: 15px;
}

.rundown-form-group label {
    display: block;
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 5px;
    font-weight: 500;
}

.rundown-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rundown-form-group input:focus {
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.2);
    outline: none;
}

.rundown-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.rundown-item-form {
    display: grid;
    grid-template-columns: 1fr 40px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background-color: #f9fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rundown-item-form input {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.9rem;
}

.rundown-item-form-remove {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.add-rundown-item-button {
    padding: 8px;
    background-color: #f0f5fa;
    border: 1px dashed #d8e2f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #4a76a8;
    transition: all 0.3s ease;
}

.add-rundown-item-button:hover {
    background-color: #e1ebf7;
}

.rundown-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.rundown-form-cancel, .rundown-form-submit {
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rundown-form-cancel {
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
}

.rundown-form-cancel:hover {
    background-color: #cbd5e0;
}

.rundown-form-submit {
    background-color: #4a76a8;
    color: white;
    border: none;
}

.rundown-form-submit:hover {
    background-color: #3a5a78;
}

/* Schedule Chapter form modal styles */
.schedule-chapter-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.schedule-chapter-form-modal.visible {
    opacity: 1;
    visibility: visible;
}

.schedule-chapter-form-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.schedule-chapter-form-modal.visible .schedule-chapter-form-container {
    transform: translateY(0);
}

.schedule-chapter-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.schedule-chapter-form-header h3 {
    font-size: 1.2rem;
    color: #2d3748;
    margin: 0;
}

.schedule-chapter-form-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.schedule-chapter-form-close:hover {
    color: #e53e3e;
}

.schedule-chapter-form-content {
    margin-bottom: 20px;
}

.schedule-chapter-form-group {
    margin-bottom: 15px;
}

.schedule-chapter-form-group label {
    display: block;
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 5px;
    font-weight: 500;
}

.schedule-chapter-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.schedule-chapter-form-group input:focus {
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.2);
    outline: none;
}

.schedule-chapter-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.schedule-chapter-item-form {
    display: grid;
    grid-template-columns: 100px 1fr 100px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background-color: #f9fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.schedule-chapter-item-form input {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.9rem;
}

.schedule-chapter-item-form-remove {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.add-schedule-chapter-item-button {
    padding: 8px;
    background-color: #f0f5fa;
    border: 1px dashed #d8e2f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #4a76a8;
    transition: all 0.3s ease;
}

.add-schedule-chapter-item-button:hover {
    background-color: #e1ebf7;
}

.schedule-chapter-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.schedule-chapter-form-cancel, .schedule-chapter-form-submit {
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.schedule-chapter-form-cancel {
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
}

.schedule-chapter-form-cancel:hover {
    background-color: #cbd5e0;
}

.schedule-chapter-form-submit {
    background-color: #4a76a8;
    color: white;
    border: none;
}

.schedule-chapter-form-submit:hover {
    background-color: #3a5a78;
}

/* Gmail section styles */
.gmail-section {
    display: none; /* Hidden by default, shown when CRM agent is selected */
}

.gmail-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.gmail-btn {
    background-color: #f0f5fa;
    border: 1px solid #d8e2f0;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: #4a5568;
}

.gmail-btn:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.gmail-btn:active {
    transform: scale(0.98);
    background-color: #d1e1f7;
}

.chat-input-container {
    display: flex;
    padding: 18px 20px;
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 5;
    width: 100%;
    transition: width 0.3s ease;
}

/* 確保聊天輸入容器在右側面板展開時不會被遮蓋 */
.chat-container .quick-select-container:not(.collapsed) ~ .chat-input-container {
    width: calc(100% - 260px);
}

#message-input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #e0e5ec;
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#message-input:focus {
    border-color: #4a76a8;
    box-shadow: 0 1px 5px rgba(74, 118, 168, 0.2);
}

/* Voice feedback styles */
#voice-feedback {
    position: absolute;
    left: 50%;
    top: -50px;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: auto;
    white-space: nowrap;
}

#voice-feedback.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

#voice-input-button {
    background-color: #f0f5fa;
    border: 1px solid #e0e5ec;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    margin-left: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#voice-input-button:hover {
    background-color: #e1ebf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

#voice-input-button:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#voice-input-button.listening {
    background: linear-gradient(135deg, #ff5252 0%, #ff1a1a 100%);
    border-color: #ff1a1a;
    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.material-icons {
    font-size: 24px;
    color: #4a76a8;
}

#voice-input-button.listening .material-icons {
    color: white;
}

#send-button {
    background: linear-gradient(135deg, #4a76a8 0%, #3a5a78 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0 25px;
    margin-left: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(74, 118, 168, 0.3);
    letter-spacing: 0.3px;
}

#send-button:hover {
    background: linear-gradient(135deg, #3a5a78 0%, #2a4a68 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 118, 168, 0.4);
}

#send-button:active {
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(74, 118, 168, 0.3);
}

/* 響應式設計 - 媒體查詢 */
/* 大型平板設備 (768px - 1024px) */
@media (max-width: 1024px) {
    .message {
        max-width: 80%;
    }
    
    .prompt-buttons-container {
        flex-wrap: wrap;
    }
    
    .prompt-btn {
        font-size: 0.85rem;
        padding: 7px 14px;
    }
    
    .chat-header h1 {
        font-size: 1.4rem;
    }
    
    .header-icon {
        height: 32px;
    }
}

/* 平板設備 (576px - 768px) */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .sidebar:not(.collapsed) ~ .chat-container {
        margin-left: 240px;
        width: calc(100% - 240px);
    }
    
    .quick-select-container {
        width: 240px;
    }
    
    .chat-container .quick-select-container:not(.collapsed) ~ .chat-messages,
    .chat-container .quick-select-container:not(.collapsed) ~ .chat-header,
    .chat-container .quick-select-container:not(.collapsed) ~ .chat-input-container,
    .chat-container .quick-select-container:not(.collapsed) ~ .prompt-buttons-container {
        width: calc(100% - 240px);
    }
    
    .message {
        max-width: 85%;
        padding: 10px 16px;
    }
    
    .chat-messages {
        padding: 20px;
    }
    
    .chat-input-container {
        padding: 15px;
    }
    
    #message-input {
        padding: 12px 16px;
    }
    
    #voice-input-button {
        width: 42px;
        height: 42px;
    }
    
    #send-button {
        padding: 0 20px;
    }
    
    .stickers-container {
        /* Adjust gap for tablet view */
        gap: 10px;
    }
}

/* 手機設備 (小於576px) */
@media (max-width: 576px) {
    body {
        overflow: auto;
    }
    
    .app-container {
        overflow: auto;
    }
    
    /* 左側邊欄樣式修改 */
    .sidebar {
        width: 80%;
        z-index: 200;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
    
    /* 添加半透明背景覆蓋層 */
    .sidebar:not(.collapsed)::before {
        content: '';
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 199;
        pointer-events: none;
    }
    
    .sidebar.visible {
        transform: translateX(0);
    }
    
    .sidebar-toggle-button {
        width: 36px;
        height: 36px;
        left: 10px;
        top: 10px;
    }
    
    .menu-toggle-button {
        width: 36px;
        height: 36px;
        right: 10px;
        top: 10px;
    }
    
    .chat-header {
        padding: 15px;
        padding-left: 55px;
    }
    
    .chat-header h1 {
        font-size: 1.2rem;
    }
    
    .current-agent-display {
        font-size: 1.2rem;
        max-width: 70%;
    }
    
    .current-agent-display .material-symbols-outlined {
        font-size: 1.5rem;
        margin-right: 5px;
    }
    
    .header-icon {
        height: 28px;
        margin-right: 8px;
    }
    
    /* 右側邊欄樣式修改 */
    .quick-select-container {
        width: 80%;
        z-index: 150;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
    
    /* 添加半透明背景覆蓋層 */
    .quick-select-container:not(.collapsed)::before {
        content: '';
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 149;
        pointer-events: none;
    }
    
    .quick-select-container:not(.collapsed) {
        transform: translateX(0);
    }
    
    /* 修改聊天容器的行為，使其在側邊欄展開時仍然部分可見 */
    .quick-select-container:not(.collapsed) ~ .chat-container {
        margin-right: 0;
        transform: translateX(-20%);
        position: absolute;
        width: 100%;
    }
    
    /* 左側邊欄展開時的聊天容器行為 */
    .sidebar:not(.collapsed) ~ .chat-container {
        transform: translateX(20%);
        width: 100%;
    }
    
    .message {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input-container {
        padding: 12px 15px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        background-color: white;
        z-index: 160;
    }
    
    /* 確保側邊欄展開時輸入框仍然可見 */
    .sidebar:not(.collapsed) ~ .chat-container .chat-input-container {
        left: 0;
        width: 100% !important;
        transform: translateX(20%);
    }
    
    .quick-select-container:not(.collapsed) ~ .chat-container .chat-input-container {
        right: 0;
        width: 100% !important;
        transform: translateX(-20%);
    }
    
    #message-input {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    #voice-input-button {
        width: 38px;
        height: 38px;
        margin-left: 8px;
    }
    
    #send-button {
        padding: 0 15px;
        margin-left: 8px;
        font-size: 0.9rem;
    }
    
    .prompt-buttons-container {
        padding: 8px 10px;
        gap: 6px;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 160;
    }
    
    /* 確保側邊欄展開時提示按鈕容器仍然可見 */
    .sidebar:not(.collapsed) ~ .chat-container .prompt-buttons-container {
        transform: translateX(20%);
    }
    
    .quick-select-container:not(.collapsed) ~ .chat-container .prompt-buttons-container {
        transform: translateX(-20%);
    }
    
    .prompt-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .stickers-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 10px;
    }
    
    .sticker {
        width: 40px;
        height: 40px;
    }
    
    .quick-select-section {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .quick-select-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .jujue-button {
        grid-gap: 8px;
    }
    
    .number-btn {
        height: 40px;
        font-size: 1.1rem;
    }
    
    .tags-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 超小型手機設備 (小於375px) */
@media (max-width: 375px) {
    .chat-header {
        padding: 12px;
        padding-left: 50px;
    }
    
    .chat-header h1 {
        font-size: 1.1rem;
    }
    
    .current-agent-display {
        font-size: 1.1rem;
        max-width: 65%;
    }
    
    .current-agent-display .material-symbols-outlined {
        font-size: 1.3rem;
        margin-right: 4px;
    }
    
    .header-icon {
        height: 24px;
        margin-right: 6px;
    }
    
    .message {
        max-width: 95%;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .chat-messages {
        padding: 12px;
        gap: 12px;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    #message-input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    #voice-input-button {
        width: 36px;
        height: 36px;
        margin-left: 6px;
    }
    
    #send-button {
        padding: 0 12px;
        margin-left: 6px;
        font-size: 0.85rem;
    }
    
    .stickers-container {
        gap: 8px;
    }
    
    .sticker {
        width: 36px;
        height: 36px;
    }
    
    .quick-select-section h3 {
        font-size: 0.85rem;
    }
    
    .quick-select-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .tags-container {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* 新增超窄手機設備的支持 */
@media (max-width: 320px) {
    .sidebar-toggle-button, .menu-toggle-button {
        width: 32px;
        height: 32px;
    }
    
    .sidebar-toggle-button {
        left: 5px;
        top: 5px;
    }
    
    .menu-toggle-button {
        right: 5px;
        top: 5px;
    }
    
    .chat-header {
        padding: 10px;
        padding-left: 42px;
    }
    
    .current-agent-display {
        font-size: 1rem;
        max-width: 60%;
    }
    
    .chat-input-container {
        padding: 8px;
    }
    
    #message-input {
        padding: 6px 10px;
    }
    
    #voice-input-button {
        width: 32px;
        height: 32px;
        margin-left: 4px;
    }
    
    #send-button {
        padding: 0 10px;
        margin-left: 4px;
        font-size: 0.8rem;
    }
    
    .material-icons {
        font-size: 20px;
    }
}
