/* ================================================= */
/* Dashboard 儀表板樣式定義 - 淺色主題與佈局優化    */
/* 關鍵調整：移除主內容區卡片滾輪；右側欄 1:1 淺色美化 */
/* ================================================= */

/* --- 顏色變數定義 (Light Theme Color Palette) --- */
:root {
  --color-primary: #212529;         /* 主色調：深灰黑 - 標題、主要文字 */
  --color-accent: #007bff;          /* 強調色：標準藍色 - 按鈕、連結 */
  --color-background: #f8f9fa;      /* 頁面背景色：極淺灰 */
  --color-card-bg: #ffffff;         /* 卡片背景色：純白色 */
  --color-border: #dee2e6;          /* 邊框線顏色 */
  --color-success: #28a745;         /* 成功提示色：綠色 */
  --color-error: #dc3545;           /* 錯誤提示色：紅色 */
  --color-info: #e9edf0;            /* 資訊區背景色：淺藍色 */
}

/* --- 基礎排版與字體設定 (Base Typography) --- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: var(--color-primary);
  line-height: 1.6;
}

h1, h3 {
  color: var(--color-primary);
}

/* --- 導航欄樣式 (Navbar Styles) --- */
.navbar {
  background-color: var(--color-card-bg);
  border-bottom: 2px solid var(--color-border);
  padding: 12px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand h2 {
  margin: 0;
  color: var(--color-primary);
  font-size: 1.4em;
  font-weight: 600;
}

.navbar-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.language-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9em;
  color: var(--color-primary);
}

.lang-btn:hover {
  background-color: #f1f3f5;
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.lang-icon {
  font-size: 1.1em;
}

.navbar-user {
  position: relative;
}

.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95em;
  color: var(--color-primary);
}

.user-button:hover {
  background-color: #f1f3f5;
  border-color: var(--color-accent);
}

.user-icon {
  font-size: 1.2em;
}

.dropdown-arrow {
  font-size: 0.7em;
  transition: transform 0.2s;
}

.user-button.active .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-in-out;
}

.user-dropdown.show {
  display: block;
}

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

.user-info-panel {
  padding: 16px;
}

.user-info-item {
  padding: 8px 0;
  font-size: 0.9em;
  color: var(--color-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info-item strong {
  color: #495057;
  font-weight: 600;
  min-width: 100px;
}

.user-info-item span {
  color: var(--color-primary);
  text-align: right;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 8px 0;
}

.logout-link {
  display: block;
  padding: 12px 16px;
  text-align: center;
  color: var(--color-error);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s;
  border-radius: 0 0 8px 8px;
}

.logout-link:hover {
  background-color: #f8f9fa;
}

/* --- 儀表板容器 (Three-Column Flex Layout) --- */
.dashboard-container {
  display: flex;
  margin: 20px; 
  gap: 15px; 
  align-items: stretch;
  /* 確保容器高度延伸至視窗底部，減去導航欄高度 */
  height: calc(100vh - 100px);
}

/* 側邊欄通用樣式 (Sidebar General) */
.sidebar {
  padding: 15px;
  background-color: var(--color-card-bg) !important;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); 
  display: flex;
  flex-direction: column;
  height: 100%; 
}

/* 左側欄：歷史紀錄區 (佔 1.5 份空間) */
#left-sidebar {
  flex: 1.5;
  min-width: 180px;
  max-width: 300px;
  overflow-y: hidden; /* 由內部的卡片控制滾動 */
}

/* 右側欄：事件與 GPU 區 (佔 2.0 份空間) */
#right-sidebar {
  flex: 2.0; 
  min-width: 250px; 
  max-width: 450px; 
  display: flex; 
  flex-direction: column; 
  overflow-y: hidden; 
  gap: 20px; 
}

/* 主內容區 (佔 5 份空間) */
#main {
  flex: 5; 
  min-width: 400px; 
  background-color: var(--color-card-bg) !important;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  max-height: 100%; 
}

/* --- 卡片通用樣式 (Card Styling with Scroll) --- */
.card {
  background-color: var(--color-card-bg) !important; 
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0; 
  
  /* 統一卡片內容滾動設置 (預設啟用) */
  max-height: 40vh; 
  overflow-y: auto; 
  margin-bottom: 15px; 
}

/* ---------------------------------------------------- */
/* 關鍵功能：移除主內容區 (#main) 卡片的滾輪功能 */
#main .card {
  max-height: none; /* 移除高度限制 */
  overflow-y: visible; /* 禁用滾輪 */
}
/* ---------------------------------------------------- */

/* 左側欄歷史紀錄卡片撐滿整個側欄高度 */
#left-sidebar .card {
  max-height: none;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0;
}


/* 卡片標題樣式 */
.card h3 {
  margin-top: 0;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

/* --- 右側欄區塊 (Event List & GPU: 1:1 Height Distribution) --- */

/* 抓癢事件列表容器 (佔 1 份空間) */
#eventListContainer {
  /* 強制 1:1 比例 */
  flex: 1; 
  min-height: 100px; 
  max-height: none; 
  overflow-y: auto; /* 列表內容可以滾動 */
  margin-bottom: 0; 
  
  /* 保持卡片的視覺樣式 */
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* GPU 資訊包裝器 (佔 1 份空間) */
#gpu-wrapper {
  /* 強制 1:1 比例 */
  flex: 1; 
  min-height: 100px; 
  flex-shrink: 0; 
  margin-top: 0; 
  max-height: none; 
  overflow-y: auto; /* 讓 GPU 資訊內部也可以滾動 */
}

/* GPU 資訊卡片本體 (保持淺色背景) */
.gpu-card {
  background-color: var(--color-card-bg) !important;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  max-height: none; 
  overflow-y: visible;
  margin-bottom: 0; 
}

/* GPU 資訊卡片內的子元素樣式調整 (美觀/淺色化) */
.gpu-header {
  /* 確保標題背景為淺色 */
  background-color: var(--color-card-bg) !important;
}

/* 讓 GPU 資訊的文字保持黑色，並移除所有可能的深色背景 */
.gpu-card strong {
  font-size: 0.9em; 
  color: var(--color-primary); /* 確保文字為黑色 */
}

.gpu-card {
  margin-bottom: 10px;
}

/* GPU 使用率橫條 (如果存在) */
.gpu-card .progress-bar-container {
  background-color: #e9ecef; /* 使用淺灰色背景 */
}

/* GPU 資訊圖表區塊 (圖表下方的數字) */
.gpu-stats {
  /* 確保圖表區塊文字為黑色，並避免深色背景 */
  color: var(--color-primary); 
  display: flex;
  align-items: center;
  gap: 10px; 
  flex-wrap: wrap;
}

.badge {
  /* 使用強調藍色作為標籤背景 */
  background-color: var(--color-accent);
  color: white;
  padding: 3px 8px; 
  border-radius: 12px;
  font-size: 0.75em; 
  font-weight: bold;
}

.small-label {
  font-size: 0.7em; 
  color: #6c757d;
  margin-bottom: 2px;
}

/* 確保左側歷史記錄選中的按鈕顏色保持美觀 */
#left-sidebar .history-list button.active {
    background-color: var(--color-accent);
    color: white;
    border-color: #0056b3;
    font-weight: bold;
}

/* 抓癢事件列表內容調整 (美觀/淺色化) */
#eventListContainer > ul {
    list-style: none;
    padding: 0;
}

#eventListContainer li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f5; /* 極淺分隔線 */
    color: var(--color-primary);
}
/* -------------------------------------------------- */


/* --- 歷史紀錄列表 --- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.history-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background-color: #f1f1f1; 
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.95em;
  transition: background-color 0.2s, border-color 0.2s;
}

.history-list button:hover {
  background-color: #e2e6ea;
}

/* 歷史記錄項目按鈕（顯示檔名的主按鈕）*/
.btn-history-item {
  flex: 1;
  min-width: 0; /* 允許縮小 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background-color: #f1f1f1;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.95em;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-history-item:hover {
  background-color: #e2e6ea;
}

.btn-history-item.active {
  background-color: var(--color-accent);
  color: white;
  border-color: #0056b3;
  font-weight: bold;
}

/* 刪除按鈕樣式 */
.btn-delete {
  padding: 10px 8px !important;
  background-color: var(--color-error) !important;
  color: white !important;
  border: 1px solid #c82333 !important;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.2s;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  margin: 0 !important;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete:hover {
  background-color: #c82333 !important;
}

/* 重新標注按鈕樣式 */
.btn-remark {
  background-color: #ffc107;
  color: #212529;
  border: none;
  padding: 10px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.2s;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remark:hover {
  background-color: #e0a800;
  transform: scale(1.05);
}


/* --- 影片與 Canvas 區塊 (Video and Canvas Area) --- */
#wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 比例 */
  height: 0;
  overflow: hidden;
  background-color: #000000;
  margin-bottom: 15px;
  border-radius: 8px;
}

#videoPreview, #markingCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; 
  background-color: #000000;
  border-radius: 8px;
}

#markingCanvas {
  z-index: 10;
  background: transparent;
  display: none;
}

/* --- 控制元件與資訊 --- */
.control-buttons {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}

button {
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  background-color: var(--color-accent);
  color: white;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover:not(:disabled) {
  background-color: #0056b3; 
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

input[type="file"] {
  margin-bottom: 15px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background-color: var(--color-card-bg);
}

#videoInfo {
  margin-bottom: 15px;
  padding: 10px;
  background-color: var(--color-info); 
  border: 1px solid #cceeff;
  border-radius: 5px;
  font-size: 0.9em;
  max-height: 200px;
  overflow-y: auto;
}

/* --- 進度條 (Progress Bar) --- */
#progressBarContainer {
  width: 100%;
  background-color: #e9ecef;
  border-radius: 8px;
  height: 30px;
  margin-top: 15px;
  overflow: hidden;
  display: none;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  border-radius: 8px;
  transition: width 0.3s ease-in-out;
  position: relative;
}

#progressText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #333;
  font-weight: 600;
  font-size: 14px;
  z-index: 1;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}


/* --- 抓癢事件按鈕樣式 --- */
.btn-seek-time {
  background-color: #6c757d; 
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.85em;
  margin-right: 5px;
  display: inline-block; 
}

.btn-seek-time:hover:not(:disabled) {
  background-color: #5a6268;
}

/* --- 下載按鈕樣式 --- */
.btn-download {
  background-color: var(--color-accent);
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-download:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-download:active {
  transform: translateY(0);
}

/* 進階下載按鈕樣式 */
.btn-download-advanced {
  background-color: #6c757d;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-download-advanced:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-download-advanced:active {
  transform: translateY(0);
}

/* --- Modal 對話框樣式 --- */
.modal-overlay {
  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: 2000;
  animation: fadeIn 0.2s ease-in-out;
}

.modal-content {
  background-color: var(--color-card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  margin: 0;
  color: var(--color-primary);
  border: none;
  padding: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5em;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: #f1f3f5;
  color: var(--color-primary);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid var(--color-border);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.form-group label:hover {
  background-color: #f8f9fa;
}

.form-group input[type="radio"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
}

.btn-primary {
  background-color: var(--color-accent);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.2s;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-add-mapping {
  background-color: #28a745;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
}

.btn-add-mapping:hover {
  background-color: #218838;
}

code {
  background-color: #f1f3f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #e83e8c;
}

/* --- Mark ID 對應輸入樣式 --- */
.mapping-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.mapping-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mapping-label {
  min-width: 80px;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95em;
}

.mapping-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.9em;
  transition: all 0.2s;
}

.mapping-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.mapping-input::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* --- 繪圖區塊樣式 --- */
.gpu-stats canvas {
  max-width: 100%;
  height: 50px; 
}

.error {
  color: var(--color-error);
  font-weight: bold;
}

/* --- 彈窗與放大效果 (Modal and Zoom Effects) --- */
/* 標記操作說明彈窗容器 */
.custom-alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* 彈窗內容 */
.custom-alert {
  display: none; /* 預設為隱藏 */
  position: fixed; /* 固定在視窗中 */
  z-index: 1000; /* 確保位於最上層 */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4); /* 半透明黑色背景 */
}

.alert-content {
  background-color: #fefefe;
  margin: 15% auto; /* 距離頂部 15% 並水平置中 */
  padding: 20px;
  border: 1px solid #888;
  width: 80%; /* 寬度可依需求調整 */
  max-width: 500px; /* 最大寬度 */
  position: relative;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
  animation-name: animatetop;
  animation-duration: 0.4s;
}

.alert-content img {
  max-width: 100%; /* 讓圖片能適應容器寬度 */
  height: auto;
  margin-top: 10px;
}

/* 分析結果圖片點擊放大 */
.zoomable-image {
  cursor: zoom-in;
  transition: transform 0.3s ease;
  max-width: 100%; 
  height: auto; 
}

.zoomable-image.zoomed-in {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.5); 
  max-width: 90vw; 
  max-height: 90vh; 
  z-index: 999;
  cursor: zoom-out;
  background-color: rgba(0, 0, 0, 0.8); 
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  object-fit: contain; 
}

/* --- 響應式佈局 (Media Queries for Responsiveness) --- */

/* 平板尺寸 (1024px 以下) - 改為垂直堆疊 */
@media (max-width: 1024px) {
  .navbar {
      padding: 10px 15px;
  }
  
  .navbar-brand h2 {
      font-size: 1.2em;
  }
  
  .navbar-controls {
      gap: 10px;
  }
  
  .lang-btn {
      padding: 6px 10px;
      font-size: 0.85em;
  }
  
  .dashboard-container {
      flex-direction: column; 
      align-items: stretch; 
      margin: 10px;
      height: auto;
  }

  #left-sidebar, #right-sidebar, #main {
      flex: 1; 
      width: auto; 
      max-width: none; 
      min-width: 0;
      margin-bottom: 15px;
      max-height: none; 
      overflow-y: visible; 
  }
  
  /* 垂直堆疊順序：歷史紀錄 -> 主內容 -> GPU/事件列表 */
  #left-sidebar { order: 1; }
  #main { order: 2; }
  #right-sidebar { order: 3; }
  
  /* 垂直時，卡片取消高度限制和滾動 */
  .card {
      max-height: none; 
      overflow-y: visible;
  }
  
  #eventListContainer {
      max-height: none; 
      overflow-y: visible;
      margin-bottom: 10px;
      flex: none; 
  }
  
  #gpu-wrapper {
      flex: none;
      margin-top: 0;
  }
}

/* 手機尺寸 (600px 以下) */
@media (max-width: 600px) {
  .navbar {
      padding: 8px 10px;
      flex-wrap: wrap;
  }
  
  .navbar-brand h2 {
      font-size: 1em;
  }
  
  .navbar-controls {
      flex-wrap: wrap;
      gap: 8px;
  }
  
  .lang-btn {
      padding: 5px 8px;
      font-size: 0.8em;
  }
  
  .user-button {
      padding: 6px 12px;
      font-size: 0.85em;
  }
  
  .user-dropdown {
      min-width: 240px;
      right: -10px;
  }
  
  .dashboard-container {
      margin: 5px;
      gap: 10px;
  }
  
  #main {
      padding: 10px;
  }
  
  h1 {
      font-size: 1.5em;
  }

  /* GPU 統計數據在手機上垂直堆疊 */
  .gpu-stats {
      flex-direction: column;
      align-items: flex-start;
  }
  
  #wrapper {
      padding-bottom: 65%; 
  }
}


/* --- 批次模式和重新標注按鈕樣式 --- */
.btn-batch-mode {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-batch-mode:hover {
  background-color: #5a6268;
}

.btn-batch-mode.active {
  background-color: var(--color-accent);
}

#batchControls {
  padding: 10px;
  background-color: var(--color-info);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

#batchControls button {
  background-color: var(--color-accent);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

#batchControls button:hover:not(:disabled) {
  background-color: #0056b3;
}

#batchControls button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}
