body {
    background-color: #2e2e2e;
    color: #ffffff;
}

.roboto-mono-webfont {
  font-family: "Roboto Mono", monospace;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
}
a {
    color: #66ccff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2 {
    color: #ffffff;
}

.container {
    width: 1000px;
    margin: 0 auto; /* 使内容居中 */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #666666;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #444444;
}

input[type="text"] {
    width: 95%;
    background-color: #555555;
    color: #ffffff;
    border: 1px solid #666666;
    padding: 5px;
}

button {
    background-color: #444444;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    margin: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #555555;
}

/* 添加返回按钮的样式 */
.back-button {
    display: inline-block;
    margin-bottom: 20px;
    background-color: #444444;
    color: #ffffff;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
}

.back-button:hover {
    background-color: #555555;
}

/* 通知元素的样式 */
.notification {
    display: none;
    position: fixed;
    top: 20px; /* 将初始位置设置为距离顶部20px */
    left: 50%;
    transform: translate(-50%, 0); /* 初始位置在视口内 */
    background-color: #66bb6a; /* 淡绿色 */
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 1000;
    opacity: 0; /* 初始透明度为0 */
}

/* 通知的动画效果 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px); /* 从上方移动进来 */
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px); /* 向上移出视图 */
    }
}

.slide-down-in {
    animation: fadeInDown 0.5s forwards;
}

.slide-down-out {
    animation: fadeOutUp 0.5s forwards;
}
.description-box {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background-color: #444444;
    color: #ffffff;
    box-sizing: border-box;
}

/* 登入失敗顯示的東西 */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4d4d;
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
}

.fade-in {
    animation: fadeInDown 0.5s forwards;
}

.fade-out {
    animation: fadeOutUp 0.5s forwards;
}

/* 登出按鈕樣式 */
.logout_button {
    position: absolute; /* 改為絕對定位 */
    top: 50%; /* 垂直居中 */
    left: 50%; /* 水平居中 */
    transform: translate(-50%, -50%); /* 將位置偏移以實現居中 */
    background-color: #444;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.logout_button:hover {
    background-color: #555;
}

.logout_button:active {
    background-color: #666;
}

/* Bot 列表的容器樣式 */
.bot_list_container {
    background-color: #444;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Bot 列表的樣式 */
.bot_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Bot 列表項目樣式 */
.bot_list_item {
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Bot 列表項目的連結樣式 */
.bot_list_item a {
    color: #66ccff;
    text-decoration: none;
    font-size: 16px;
    display: block; /* 讓連結覆蓋整個項目區域 */
}

/* 滑鼠懸停時的效果 */
.bot_list_item:hover {
    background-color: #555;
    transform: translateY(-3px);
}

/* Bot 列表標題樣式 */
.bot_list_title {
    font-size: 20px; /* 調整字體大小 */
    color: #ffffff;
    margin-bottom: 15px; /* 與列表的間距 */
    padding-bottom: 3px; /* 增加高度 */
    margin-top: 5px;
}

/* 公告容器樣式 */
.announcement_container {
    background-color: #444;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none;
}

.announcement_title {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 15px;
    padding-bottom: 3px;
    margin-top: 5px;
}

.announcement_item {
    background-color: #555;
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    white-space: pre-line;
}
.log-box {
    margin-top: 20px;
}

.log-box-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.log-content {
    background-color: #333333;
    border-radius: 6px;
    padding: 10px;
    max-height: 260px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #ffffff;
    font-family: "Roboto Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #555555;
}

/* ========== 機器人後台頁面樣式 ========== */

/* 主容器 - 全屏布局 */
.bot-page-container {
    display: flex;
    height: calc(100vh - 16px);
    width: calc(100% - 16px);
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    font-family: "Roboto Mono", monospace;
    border-radius: 12px;
    margin: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 左側機器人列表 (1/5) */
.bot-list-sidebar {
    width: 20%;
    background-color: #1e1e2e;
    border-right: 1px solid #2a2a3e;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #2a2a3e;
    background-color: #252538;
}

.sidebar-header h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #ffffff;
    font-weight: 300;
}

.back-link {
    color: #66ccff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
}

.back-link:hover {
    color: #88ddff;
    transform: translateX(-3px);
}

/* 機器人列表 */
.bot-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.bot-list-item {
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.bot-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 204, 255, 0.1) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.bot-list-item:hover::before {
    width: 100%;
}

.bot-list-item:hover {
    background-color: #2a2a3e;
    border-left-color: #66ccff;
}

.bot-list-item.active {
    background-color: #2a2a3e;
    border-left-color: #66ccff;
    background: linear-gradient(90deg, rgba(102, 204, 255, 0.15) 0%, transparent 100%);
}

.bot-list-item.active .bot-name {
    color: #66ccff;
    font-weight: 400;
}

.bot-name {
    color: #e0e0e0;
    font-size: 15px;
    transition: all 0.3s ease;
    display: block;
}

.logout-section {
    padding: 20px;
    border-top: 1px solid #2a2a3e;
    background-color: #252538;
}

.logout-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
}

.logout-link:hover {
    color: #ff8e8e;
    transform: translateX(3px);
}

/* 右側配置面板 (4/5) */
.bot-config-panel {
    width: 80%;
    overflow-y: auto;
    background-color: #1a1a2e;
    position: relative;
}

.config-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a2a3e;
}

.config-header h1 {
    margin: 0;
    font-size: 28px;
    color: #ffffff;
    font-weight: 300;
}

/* 配置表單 */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.config-section {
    background-color: #252538;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 1px solid #2a2a3e;
}

.config-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.config-label {
    display: block;
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 12px;
    font-weight: 400;
}

.license-display {
    background-color: #1e1e2e;
    border: 1px solid #3a3a4e;
    border-radius: 8px;
    padding: 12px 16px;
    color: #66ccff;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s ease;
}

.license-display:hover {
    border-color: #66ccff;
    background-color: #252538;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* 按鈕樣式 */
.add-btn, .save-btn {
    background: linear-gradient(135deg, #66ccff 0%, #5599cc 100%);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 204, 255, 0.3);
}

.add-btn:hover, .save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 204, 255, 0.4);
    background: linear-gradient(135deg, #77ddff 0%, #66aadd 100%);
}

.add-btn:active, .save-btn:active {
    transform: translateY(0);
}

.save-btn {
    margin-top: 16px;
    padding: 12px 32px;
    font-size: 16px;
}

/* 實況主表格 */
.streamer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1e1e2e;
}

.streamer-table thead {
    background-color: #2a2a3e;
}

.streamer-table th {
    padding: 14px 16px;
    text-align: left;
    color: #e0e0e0;
    font-weight: 400;
    font-size: 14px;
    border: none;
    border-bottom: 1px solid #3a3a4e;
}

.streamer-table tbody tr {
    background-color: #1e1e2e;
    transition: all 0.3s ease;
    border-bottom: 1px solid #2a2a3e;
}

.streamer-table tbody tr:hover {
    background-color: #252538;
    transform: scale(1.01);
}

.streamer-table tbody tr:last-child {
    border-bottom: none;
}

.streamer-table td {
    padding: 14px 16px;
    border: none;
}

.streamer-input {
    width: 100%;
    background-color: #1a1a2e;
    border: 1px solid #3a3a4e;
    border-radius: 6px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 14px;
    font-family: "Roboto Mono", monospace;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.streamer-input:focus {
    outline: none;
    border-color: #66ccff;
    background-color: #252538;
    box-shadow: 0 0 0 3px rgba(102, 204, 255, 0.1);
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    margin-right: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Roboto Mono", monospace;
}

.delete-btn {
    background-color: #ff6b6b;
    color: #ffffff;
}

.delete-btn:hover {
    background-color: #ff8e8e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.visit-btn {
    background-color: #4ecdc4;
    color: #ffffff;
}

.visit-btn:hover {
    background-color: #6eddd4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(78, 205, 196, 0.3);
}

/* Sortable 拖動效果 */
.sortable-ghost {
    opacity: 0.4;
    background-color: #2a2a3e;
}

/* 資訊框 */
.info-box {
    background-color: #1e1e2e;
    border: 1px solid #3a3a4e;
    border-radius: 8px;
    padding: 20px;
}

.info-box h3 {
    margin: 0 0 12px 0;
    color: #66ccff;
    font-size: 16px;
    font-weight: 400;
}

.info-box ul {
    margin: 0;
    padding-left: 0;
    color: #e0e0e0;
    line-height: 1.8;
    list-style-type: none;
}

.info-box li {
    margin-bottom: 8px;
    font-size: 14px;
}

/* 日誌區域 */
.log-section {
    background-color: #1e1e2e;
    border: 1px solid #3a3a4e;
    border-radius: 8px;
    padding: 20px;
}

.log-header {
    font-size: 16px;
    color: #66ccff;
    margin-bottom: 12px;
    font-weight: 400;
}

.log-content {
    background-color: #1a1a2e;
    border: 1px solid #3a3a4e;
    border-radius: 6px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e0e0e0;
    font-family: "Roboto Mono", monospace;
    font-size: 13px;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.log-content:hover {
    border-color: #4a4a5e;
}

/* 通知樣式更新 */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 15px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.4);
    opacity: 0;
    transform: translateY(-20px);
    display: none;
}

.notification.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* 空狀態樣式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: #e0e0e0;
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h2 {
    font-size: 24px;
    color: #ffffff;
    margin: 0 0 12px 0;
    font-weight: 300;
}

.empty-state p {
    font-size: 16px;
    color: #a0a0a0;
    margin: 0;
}

/* 載入動畫 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #2a2a3e;
    border-top: 4px solid #66ccff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .config-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .bot-page-container {
        flex-direction: column;
    }
    
    .bot-list-sidebar {
        width: 100%;
        height: 200px;
    }
    
    .bot-config-panel {
        width: 100%;
    }
}

/* 滾動條樣式 */
.bot-list-sidebar::-webkit-scrollbar,
.bot-config-panel::-webkit-scrollbar,
.log-content::-webkit-scrollbar {
    width: 8px;
}

.bot-list-sidebar::-webkit-scrollbar-track,
.bot-config-panel::-webkit-scrollbar-track,
.log-content::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.bot-list-sidebar::-webkit-scrollbar-thumb,
.bot-config-panel::-webkit-scrollbar-thumb,
.log-content::-webkit-scrollbar-thumb {
    background: #3a3a4e;
    border-radius: 4px;
}

.bot-list-sidebar::-webkit-scrollbar-thumb:hover,
.bot-config-panel::-webkit-scrollbar-thumb:hover,
.log-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a5e;
}

/* ========== 公告彈出視窗樣式 ========== */

.announcement-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.announcement-modal.show {
    opacity: 1;
}

.announcement-modal-content {
    background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #3a3a4e;
    overflow: hidden;
}

.announcement-modal.show .announcement-modal-content {
    transform: scale(1) translateY(0);
}

.announcement-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #3a3a4e;
    background-color: #2a2a3e;
}

.announcement-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #ffffff;
    font-weight: 400;
}

.announcement-close-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    line-height: 1;
}

.announcement-close-btn:hover {
    background-color: #3a3a4e;
    color: #ffffff;
    transform: rotate(90deg);
}

.announcement-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    color: #e0e0e0;
    line-height: 1.8;
    font-size: 15px;
}

.announcement-item {
    margin-bottom: 16px;
    white-space: pre-line;
    word-break: break-word;
}

.announcement-item:last-child {
    margin-bottom: 0;
}

.announcement-separator {
    border: none;
    border-top: 1px solid #3a3a4e;
    margin: 20px 0;
}

.announcement-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-top: 1px solid #3a3a4e;
    background-color: #2a2a3e;
}

.announcement-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 14px;
    user-select: none;
}

.announcement-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #66ccff;
}

.announcement-checkbox-label span {
    transition: color 0.3s ease;
}

.announcement-checkbox-label:hover span {
    color: #ffffff;
}

.announcement-ok-btn {
    background: linear-gradient(135deg, #66ccff 0%, #5599cc 100%);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 204, 255, 0.3);
    font-family: "Roboto Mono", monospace;
}

.announcement-ok-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 204, 255, 0.4);
    background: linear-gradient(135deg, #77ddff 0%, #66aadd 100%);
}

.announcement-ok-btn:active {
    transform: translateY(0);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .announcement-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .announcement-modal-header {
        padding: 20px 24px;
    }
    
    .announcement-modal-header h2 {
        font-size: 20px;
    }
    
    .announcement-modal-body {
        padding: 20px 24px;
        font-size: 14px;
    }
    
    .announcement-modal-footer {
        padding: 16px 24px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .announcement-ok-btn {
        width: 100%;
    }
}

