/* ===== CSS 變數引用 ===== */
/* 
這個文件使用 manage-theme.css 中定義的 CSS 變數：
--primary-color: #00d2be
--bg-card: #1a2332
--text-white: #ffffff
--text-light: #e0e6ed
--border-color: rgba(0, 210, 190, 0.8)
*/

/* ===== CSS Reset 和基礎設定 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== 基礎字體和佈局 ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-white);
  min-height: 100vh;
}

/* 預設主題（淺色） */
body.default-theme {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--text-white);
}

/* 深色主題 */


/* 任務頁面主題 */
body.challenge-theme {
  background: #000000;
  color: #ffffff;
}

/* ===== 容器和佈局 ===== */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== 基礎卡片樣式 ===== */
.card {
  border-radius: 15px;
  padding: 30px;
  margin: 20px 0;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 預設主題卡片 */
body.default-theme .card {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.default-theme .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* ===== 基礎標題樣式 ===== */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
}

h1 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.default-theme h1 {
  color: #fff;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
}

/* ===== 基礎表單元素 ===== */
input, select, textarea, button {
  font-family: inherit;
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  margin-bottom: 15px;
}

button {
  cursor: pointer;
  border: none;
  padding: 10px 20px;
  font-weight: 500;
}

/* ===== 基礎表格樣式 ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  font-weight: 600;
}

/* ===== 基礎工具類別 ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .card {
    padding: 20px;
    margin: 10px 0;
  }
}

h2 {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 1.8rem;
}

h3 {
  color: var(--text-white);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

/* 表單樣式 */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-light);
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: var(--bg-card);
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* 檔案上傳樣式 */
.file-upload {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: block;
  padding: 12px 16px;
  border: 2px dashed var(--text-gray);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  background: var(--bg-card-light);
}

.file-upload-label:hover {
  border-color: var(--primary-color);
  background: #edf2f7;
}

.file-upload-label.has-file {
  border-color: #48bb78;
  background: #f0fff4;
  color: #22543d;
}

/* 按鈕樣式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-light);
}

.btn-secondary:hover {
  background: var(--text-gray);
}

.btn-success {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.6);
}

.btn-danger {
  background: linear-gradient(135deg, #f56565 0%, #dc3545 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 101, 101, 0.6);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 載入動畫 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 載入覆蓋層 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 表單專用載入內容 */
.form-loading-content {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  min-width: 300px;
}

/* 表單專用載入動畫 */
.loading-spinner-form {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

/* 搜尋和操作區域 */
.search-and-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.search-filters {
  display: flex;
  gap: 15px;
  flex: 1;
  align-items: center;
}

.problem-filter-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.problem-filter-container .btn {
  white-space: nowrap;
  font-size: 14px;
  padding: 8px 16px;
}

.problem-filter-container .btn.active {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

.search-container {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.status-filter-container {
  min-width: 120px;
}

.status-filter {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.3s ease;
}

.status-filter:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.status-filter option.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-filter option.status-verified {
  background-color: #d1fae5;
  color: #065f46;
}

.status-filter option.status-inactive {
  background-color: #f3f4f6;
  color: #374151;
}

.search-input {
  width: 100%;
  padding: 12px 45px 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-card);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  font-size: 1.2rem;
  pointer-events: none;
}

/* 搜尋模式切換按鈕 */
.search-mode-btn {
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.search-mode-btn:hover {
  border-color: var(--primary-color);
  background: var(--bg-card-light);
}

.search-mode-btn.active {
  border-color: var(--primary-color) !important;
  background: linear-gradient(135deg, #00d2be 0%, #00a896 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 4px rgba(0, 210, 190, 0.3) !important;
}

/* 搜尋進度彈窗 */
#searchProgressModal .modal-content {
  text-align: center;
}

#searchProgressModal .progress-container {
  margin: 20px 0;
}

/* 手機端搜尋優化 */
@media (max-width: 576px) {
  .search-container {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .search-mode-toggle {
    width: 100%;
    justify-content: center;
  }
  
  .search-mode-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 0.8rem;
  }
  
  #executeSearchBtn {
    width: 100%;
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .search-and-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-filters {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
  }
  
  .search-container {
    max-width: none;
  }
  
  .status-filter-container {
    min-width: auto;
  }
}

/* 訊息樣式 */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-weight: 500;
}

.alert-success {
  background: #f0fff4;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.alert-error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #feb2b2;
}

.alert-info {
  background: #ebf8ff;
  color: #2a4365;
  border: 1px solid #90cdf4;
}

/* 網格佈局 */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* 用戶資訊區塊樣式 */
.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.user-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
  color: #1a202c;
  font-size: 0.95rem;
}

.user-email {
  color: var(--text-light);
  font-size: 0.85rem;
}

.logout-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: #c53030;
  transform: translateY(-1px);
}

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

/* 響應式設計 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .card {
    padding: 20px;
    margin: 10px 0;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }
  
  .card {
    padding: 15px;
  }
  
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px; /* 防止 iOS 縮放 */
  }
}

/* 工具類別 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.hidden { display: none; }
.visible { display: block; }

/* 動畫效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ===== 頁面切換樣式 ===== */

/* 頁面切換按鈕 */
.page-switcher {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: fit-content;
  min-width: 600px;
  margin-left: auto;
  margin-right: auto;
  gap: 2px;
}

.switch-btn {
  flex: 0 0 auto;
  padding: 12px 18px;
  border: none;
  background: transparent;
  color: var(--text-gray, #8892a6);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  white-space: nowrap;
}

.switch-btn:hover {
  background-color: rgba(0, 210, 190, 0.1);
  color: var(--text-white);
}

.switch-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 頁面內容 */
.page-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.page-content.active {
  display: block;
}

/* 格式說明樣式 */
.format-info {
  background-color: rgba(0, 210, 190, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
}

.format-example {
  margin-top: 15px;
}

.format-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.format-table th,
.format-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.format-table th {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  font-weight: 600;
}

.format-table tbody tr:hover {
  background-color: rgba(0, 210, 190, 0.1);
}

.example-data {
  margin-top: 15px;
}

.example-data pre {
  background: var(--text-white);
  color: var(--border-color);
  padding: 15px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  white-space: pre;
}

/* ===== 管理員頁面樣式 ===== */

/* 導航列樣式 */
.nav-bar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 15px 20px;
  margin-bottom: 30px;
  border-radius: 10px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.nav-brand h2 {
  margin: 0;
  color: white;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.8);
}

/* 上傳區域樣式 */
.upload-section {
  margin-bottom: 30px;
}

.upload-area {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  background-color: #fafafa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary-color);
  background-color: #f0f4ff;
}

.upload-content .upload-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.file-info {
  margin-top: 20px;
  padding: 15px;
  background-color: #e8f4fd;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* 進度條樣式 */
.progress-container {
  margin-top: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  transition: width 0.3s ease;
  width: 0%;
}

/* 搜尋區域樣式 */
.search-section {
  margin-bottom: 20px;
}

/* 統計卡片樣式 */
.stats-section {
  margin-bottom: 20px;
}



.stat-card .stat-number {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 2px;
  color: white;
}

.stat-card .stat-label {
  font-size: 0.7rem;
  opacity: 0.9;
  color: white;
}

/* 資料表格樣式 */
.data-table-container {
  background: var(--bg-card);
  border-radius: 10px;
  overflow: visible; /* 改為 visible 以顯示下拉選單 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch; /* 改善移動端滾動體驗 */
}

/* 確保操作欄位的下拉選單不被裁切 */
.data-table td:last-child {
  overflow: visible;
}

.table-responsive .data-table-container {
  min-width: 1550px; /* 增加最小寬度以更好利用 1600px 容器空間 */
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background-color: rgba(0, 210, 190, 0.1);
  font-weight: 600;
  color: var(--text-white);
}

.data-table tbody tr:hover {
  background-color: rgba(0, 210, 190, 0.1);
}

/* 空狀態和錯誤狀態樣式 */
.empty-state,
.error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray, #8892a6);
}

.empty-icon,
.error-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.loading-placeholder {
  text-align: center;
  padding: 40px;
  color: var(--text-gray, #8892a6);
}

/* 模態框樣式 */
.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: 1000;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-gray, #8892a6);
}

.modal-body {
  padding: 20px;
}

/* 上傳區域佈局 */
.upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.upload-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.format-info {
  background-color: rgba(0, 210, 190, 0.1);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.upload-area {
  background-color: rgba(0, 210, 190, 0.1);
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.highlight {
  border-color: #00d2be;
  background: #e3f2fd;
}

/* 表單操作按鈕 */
.form-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* 四欄網格 */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

/* 五欄網格 */
.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .upload-layout {
    grid-template-columns: 1fr;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .upload-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

.branch-list {
  max-height: 400px;
  overflow-y: auto;
}

.branch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.branch-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.branch-name {
  font-weight: 500;
  font-size: 1rem;
}

.branch-code {
  color: var(--text-gray, #8892a6);
  font-family: monospace;
  font-size: 0.9rem;
}

.branch-item .btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-width: 70px;
}

/* 狀態標籤樣式 */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  min-width: 60px;
  display: inline-block;
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #856404;
}

.status-success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.status-default {
  background: #e2e3e5;
  color: var(--text-light, #e0e6ed);
  border: 1px solid #ced4da;
}

/* 檔案查看按鈕樣式 */
.btn-info {
  background: #17a2b8;
  color: white;
  border: 1px solid #17a2b8;
}

.btn-info:hover {
  background: #138496;
  border-color: #117a8b;
  color: white;
}

/* 新增 inactive 狀態樣式 */
.status-inactive {
  background: #6c757d;
  color: white;
  border: 1px solid #5a6268;
}

/* 狀態選擇器樣式 */
.status-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ced4da;
  font-size: 0.875rem;
  min-width: 80px;
  font-weight: 500;
}

.status-select:focus {
  outline: none;
  border-color: #00d2be;
  box-shadow: 0 0 0 2px rgba(0, 210, 190, 0.25);
}

/* 狀態選擇器根據值設定顏色 */
.status-select[data-status="pending"],
.status-select[data-status="upload_partial_failed"],
.status-select[data-status="upload_failed"] {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: #dc3545 !important;
    font-weight: 600 !important;
}

.status-select[data-status="verified"] {
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    color: #28a745 !important;
    font-weight: 600 !important;
}

.status-select[data-status="inactive"] {
    background: rgba(107, 114, 128, 0.3) !important;
    border: 1px solid rgba(107, 114, 128, 0.5) !important;
    color: #6c757d !important;
    font-weight: 600 !important;
}

/* 操作欄位置中和對齊 */
.data-table td:last-child {
  text-align: center;
  vertical-align: middle;
  padding: 12px 8px;
}

.data-table .btn {
  margin: 0 auto;
  display: inline-block;
}

/* 確保表格行高一致 */
.data-table td {
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

/* 操作按鈕區域樣式 */
.action-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.submit-time {
  font-size: 0.8rem;
  color: var(--text-gray, #8892a6);
  text-align: center;
  line-height: 1.2;
}

/* 詳情行樣式 */
.details-row {
  background-color: rgba(0, 210, 190, 0.1);
}

/* 可搜尋下拉選單樣式 */
.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-card);
}

.searchable-select input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.searchable-select input[type="text"]:disabled {
  background: var(--bg-card-light);
  color: #a0aec0;
  cursor: not-allowed;
}

.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

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

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-card, #1a2332);
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background: #f8fafc;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item.selected {
  background: #e6fffa;
  color: #065f46;
}

.dropdown-item.no-results {
  color: #a0aec0;
  font-style: italic;
  cursor: default;
}

.dropdown-item.no-results:hover {
  background: var(--bg-card);
}

.submission-details {
  padding: 20px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin: 10px 0;
}

.submission-details h4 {
  margin: 0 0 15px 0;
  color: var(--text-light, #e0e6ed);
  border-bottom: 2px solid #00d2be;
  padding-bottom: 8px;
}

.details-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row label {
  font-weight: 500;
  color: var(--text-light, #e0e6ed);
  font-size: 0.9rem;
}

.form-row input,
.form-row textarea {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #00d2be;
  box-shadow: 0 0 0 2px rgba(0, 210, 190, 0.25);
}

.form-row textarea {
  resize: vertical;
  min-height: 60px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #dee2e6;
}

/* SWAG ID 驗證樣式 */
.swag-validation {
  margin-top: 10px;
}

.validation-loading {
  color: #6c757d;
  font-style: italic;
  padding: 8px 0;
}

.validation-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  margin: 8px 0;
  border: 1px solid;
}

.validation-result.no-data {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #0d47a1;
}

.validation-result.verified {
  background: #e8f5e8;
  border-color: #4caf50;
  color: #1b5e20;
}

.validation-result.pending {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #78350f;
}

.validation-result.inactive {
  background: rgba(239, 68, 68, 0.15);
  border-color: #dc3545;
  color: #7f1d1d;
}

.validation-result.error {
  background: rgba(239, 68, 68, 0.15);
  border-color: #dc3545;
  color: #7f1d1d;
}

.validation-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.validation-content {
  flex: 1;
}

.validation-text {
  font-weight: 500;
  margin-bottom: 8px;
}

.validation-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.detail-label {
  font-weight: 500;
  margin-right: 8px;
}

.detail-value {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
}

/* 資料表格中的按鈕樣式 - 調整大小 */
.data-table .actions {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

/* 確保表格欄位對齊 */
.data-table td {
  vertical-align: middle;
  text-align: center;
  padding: 8px 4px;
}

.data-table th {
  text-align: center;
  padding: 12px 4px;
}

.data-table .btn {
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
  border-radius: 4px;
  min-width: 48px;
  transform: scale(1.0);
  transform-origin: center;
}

.data-table .btn:hover {
  transform: scale(1.05) translateY(-1px);
}

/* 摺疊功能樣式 */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.collapsible-header:hover {
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 10px 15px;
  margin: 0 -15px 20px -15px;
}

.collapse-icon {
  font-size: 18px;
  transition: transform 0.3s ease;
  color: var(--text-gray, #8892a6);
  font-weight: bold;
}

.collapse-icon.rotated {
  transform: rotate(-90deg);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 2000px;
  opacity: 1;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

/* SWAG ID 驗證禁用狀態樣式 */
.disabled-by-validation {
  opacity: 0.6 !important;
  background-color: rgba(0, 210, 190, 0.1);
  color: #6c757d !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.disabled-by-validation::placeholder {
  color: #adb5bd !important;
}

/* 禁用狀態下的按鈕樣式 */
button.disabled-by-validation {
  background-color: rgba(0, 210, 190, 0.1);
  border-color: #dee2e6 !important;
  color: #6c757d !important;
}

/* 禁用狀態下的檔案上傳樣式 */
.file-upload input.disabled-by-validation + label {
  background-color: rgba(0, 210, 190, 0.1);
  color: #6c757d !important;
  cursor: not-allowed !important;
}

/* 禁用狀態提示 */
.form-disabled-notice {
  background: rgba(245, 158, 11, 0.15); border: 1px solid #f59e0b;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 12px;
  border-radius: 6px;
  margin: 15px 0;
  text-align: center;
  font-weight: 500;
}

/* 操作下拉選單樣式 */
.action-dropdown {
  /* position 由 JavaScript 動態設置為 fixed */
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000 !important; /* 確保在虛擬滾動容器之上 */
  min-width: 140px;
  overflow: hidden;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--bg-card-light);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: var(--bg-card-light);
}

.dropdown-item.danger:hover {
  background-color: #fed7d7;
  color: #c53030;
}

.dropdown-icon {
  margin-right: 8px;
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.dropdown-text {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

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

/* 確保表格單元格的相對定位 */
.data-table td {
  position: relative;
}

/* 訊息容器樣式 */
.message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  max-width: 400px;
}

.message {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: messageSlideIn 0.3s ease;
}

.message-success {
  border-left: 4px solid #10b981;
}

.message-error {
  border-left: 4px solid #dc3545;
}

.message-warning {
  border-left: 4px solid #ffc107;
  background-color: rgba(245, 158, 11, 0.8);
  color: #856404;
}

.message-info {
  border-left: 4px solid #17a2b8;
}

.message button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-gray, #8892a6);
  margin-left: 15px;
}

@keyframes messageSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 管理員頁面響應式設計 */
@media (max-width: 768px) {
  .nav-bar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .nav-links {
    justify-content: center;
  }
  
  .page-switcher {
    margin-bottom: 20px;
    padding: 3px;
  }
  
  .user-info {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .user-details {
    flex-direction: column;
    gap: 8px;
  }
  
  .switch-btn {
    padding: 12px 15px;
    min-width: 120px;
    font-size: 0.9rem;
  }
  
  .upload-area {
    padding: 20px;
  }
  
  .file-info {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .message-container {
    left: 10px;
    right: 10px;
    max-width: none;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
  
  .format-table {
    font-size: 0.85rem;
  }
  
  .format-table th,
  .format-table td {
    padding: 8px 10px;
  }
  
  .example-data pre {
    font-size: 0.8rem;
    padding: 10px;
  }
}

/* 載入畫面樣式 */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: white;
  animation: fade-in 0.5s ease-out;
}

.loading-content h2 {
  font-size: 2rem;
  margin: 20px 0 10px 0;
  font-weight: 600;
}

.loading-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 載入畫面響應式設計 */
@media (max-width: 768px) {
  .loading-content h2 {
    font-size: 1.5rem;
  }

  .loading-content p {
    font-size: 1rem;
  }
}

/* 超級管理員按鈕樣式 */
.switch-btn.super-admin-btn {
  background: var(--bg-card);
  color: var(--text-light);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: all 0.3s ease, background-size 0.3s ease;
}

/* 超級管理員頁面樣式 */
.super-admin-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 30px;
  text-align: center;
  margin-bottom: 30px;
  border-radius: 15px;
}

.super-admin-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 600;
}

.super-admin-header p {
  margin: 10px 0 0 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.admin-stats .stat-card .stat-number {
  color: white;
}

.admin-stats .stat-card .stat-label {
  color: white;
}

.admin-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.action-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.action-btn.danger {
  background: #dc3545;
}

.action-btn.danger:hover {
  background: #c53030;
}

.admin-table-container {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--bg-card-light);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 15px;
}

.table-header h3 {
  margin: 0;
  color: var(--text-white);
  font-size: 1.3rem;
}

.table-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input, .filter-select {
  padding: 8px 12px;
  border: 1px solid var(--text-gray);
  border-radius: 6px;
  font-size: 0.9rem;
  min-width: 120px;
}

.search-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background: var(--bg-card-light);
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table tr:hover {
  background: var(--bg-card-light);
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.role-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.role-super-admin {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
}

.role-admin {
  background: var(--bg-card);
  color: var(--text-light);
}

.role-event-admin {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
}

.role-labor-fee-admin {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
  color: #1a4731;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-active {
  background: #c6f6d5;
  color: #22543d;
}

.status-inactive {
  background: #fed7d7;
  color: #742a2a;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-edit {
  background: var(--primary-color);
  color: white;
}

.btn-edit:hover {
  background: var(--primary-dark);
}

.btn-delete {
  background: #dc3545;
  color: white;
}

.btn-delete:hover {
  background: #c53030;
}

.btn-toggle {
  background: #ed8936;
  color: white;
}

.btn-toggle:hover {
  background: #dd6b20;
}

/* 模態框樣式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
  overflow: hidden; /* 防止背景滾動 */
}

.modal-content {
  background-color: var(--bg-card);
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

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

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-white);
  margin: 0;
}

.close {
  color: #a0aec0;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close:hover {
  color: var(--text-white);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-light);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--text-gray);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 30px;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary.danger {
  background: #dc3545;
}

.btn-primary.danger:hover {
  background: #c53030;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-light);
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--text-gray);
}

.modal-body {
  margin: 20px 0;
}

.text-center {
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.switch-btn.super-admin-btn:hover {
  background-size: 100% 100%;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.switch-btn.super-admin-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.switch-btn.super-admin-btn:hover::before {
  left: 100%;
}

/* 匯入進度對話框樣式 */
.progress-info {
  padding: 20px 0;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-weight: 500;
}

.progress-bar-container {
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background-color: rgba(0, 210, 190, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #20c997);
  transition: width 0.3s ease;
  border-radius: 10px;
}

.current-processing {
  text-align: center;
  margin-bottom: 20px;
  font-size: 16px;
}

.current-processing span {
  font-weight: bold;
  color: #00d2be;
}

.import-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
}

.import-stats .stat-label {
  display: block;
  font-size: 14px;
  color: var(--text-gray, #8892a6);
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: bold;
}

.stat-value.success {
  color: #10b981;
}

.stat-value.error {
  color: #dc3545;
}

.error-details {
  margin-top: 20px;
  padding: 15px;
  background-color: #f8d7da;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 5px;
}

.error-details h4 {
  color: #fca5a5;
  margin-bottom: 10px;
}

.error-list {
  max-height: 200px;
  overflow-y: auto;
}

.error-item {
  padding: 5px 0;
  border-bottom: 1px solid #f5c6cb;
  color: #fca5a5;
  font-size: 14px;
}

/* ==================== 創作者管理樣式 ==================== */

/* 創作者配置區域 */
.creator-config-section {
  margin-bottom: 30px;
  padding: 20px;
  background-color: rgba(0, 210, 190, 0.1);
  border-radius: 8px;
}

.creator-config-section h3 {
  margin-bottom: 15px;
  color: var(--text-white);
}

.config-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.config-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.config-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 創作者資料區域 */
.creator-data-section {
  margin-top: 20px;
}

.creator-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.creator-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-selects {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  width: 50%;
  min-width: 400px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid rgba(0, 210, 190, 0.3);
  border-radius: 6px;
  font-size: 14px;
  flex: 1;
  min-width: 120px;
  background: var(--bg-card, #1a2332);
  color: var(--text-light, #e0e6ed);
}

.filter-select:focus {
  border-color: #00d2be;
  box-shadow: 0 0 0 3px rgba(0, 210, 190, 0.15);
  outline: none;
}

.filter-select option {
  background: #1a2332;
  color: #e0e6ed;
}

/* 配置管理模態框樣式 */
.config-list {
  max-height: none;
  overflow-y: visible;
  width: 100%;
  box-sizing: border-box;
}

.config-actions {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.config-actions input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.config-items-list {
  border: none;
  border-radius: 6px;
  max-height: none;
  overflow-y: visible;
  width: 100%;
  box-sizing: border-box;
}

.config-items {
  padding: 0;
}

.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.config-item:last-child {
  border-bottom: none;
}

.config-item:hover {
  background-color: rgba(0, 210, 190, 0.1);
}

.config-item-info {
  flex: 1;
}

.config-item-info strong {
  display: block;
  color: var(--text-white);
  margin-bottom: 4px;
}

.config-item-info p {
  margin: 0;
  color: var(--text-gray, #8892a6);
  font-size: 12px;
}

.config-item-actions {
  display: flex;
  gap: 8px;
}

.no-data {
  text-align: center;
  padding: 40px;
  color: var(--text-gray, #8892a6);
  font-style: italic;
}

/* 新增創作者表單樣式 */
.modal-content.large {
  max-width: 900px;
  width: 90%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-white);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-group input[readonly] {
  background-color: rgba(0, 210, 190, 0.1);
  color: var(--text-gray, #8892a6);
}

/* 創作者資料表格樣式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.data-table th {
  background-color: rgba(0, 210, 190, 0.1);
  font-weight: 600;
  color: var(--text-white);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr:hover {
  background-color: rgba(0, 210, 190, 0.1);
}

.data-table td {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 按鈕樣式 */
.action-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn:not(.primary) {
  background-color: rgba(0, 210, 190, 0.1);
  color: var(--text-white);
  border: 1px solid #ddd;
}

.action-btn:not(.primary):hover {
  background-color: rgba(0, 210, 190, 0.1);
}

.action-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

/* 狀態樣式 */
.empty-state,
.error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray, #8892a6);
}

.empty-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: block;
}

.empty-state h3,
.error-state h3 {
  margin-bottom: 10px;
  color: var(--text-white);
}

.empty-state p,
.error-state p {
  margin-bottom: 20px;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .config-buttons {
    grid-template-columns: 1fr;
  }
  
  .creator-actions {
    flex-direction: column;
  }
  
  .creator-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-selects {
    flex-direction: column;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content.large {
    width: 95%;
    margin: 20px auto;
  }
  
  .data-table {
    font-size: 12px;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 4px;
  }
}

/* 配置項目樣式 */
.config-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.config-item-card {
    background-color: rgba(0, 210, 190, 0.1);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
}

.config-item-card:hover {
    border-color: #00d2be;
    box-shadow: 0 2px 8px rgba(0, 210, 190, 0.15);
}

.config-item-info {
    flex: 1;
    margin-bottom: 0;
    min-width: 0; /* 允許內容收縮 */
    overflow: hidden; /* 防止內容溢出 */
}

.config-item-name {
    font-weight: 600;
    color: var(--text-light, #e0e6ed);
    margin-bottom: 3px;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-item-value {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-item-desc {
    font-size: 0.75em; /* 縮小字體 */
    color: #868e96;
    font-style: italic;
    margin-top: 2px; /* 減少頂部邊距 */
}

.config-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-left: 12px;
    flex-shrink: 0; /* 防止按鈕被壓縮 */
}

.config-item-actions .btn {
    padding: 6px 10px;
    font-size: 0.8em;
    white-space: nowrap; /* 防止按鈕文字換行 */
}

/* 編輯按鈕樣式 */
.config-item-actions .config-edit-btn {
    min-width: 65px;
}

/* 刪除按鈕樣式 */
.config-item-actions .config-delete-btn {
    min-width: 65px;
    padding: 6px 10px;
}

.loading, .empty-state, .error-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.empty-state {
    color: #adb5bd;
}

.error-state {
    color: #dc3545;
}

/* 內嵌編輯下拉選單樣式 */
.inline-edit-select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-edit-select:hover {
    border-color: #00d2be;
    box-shadow: 0 0 0 2px rgba(0, 210, 190, 0.1);
}

.inline-edit-select:focus {
    outline: none;
    border-color: #00d2be;
    box-shadow: 0 0 0 3px rgba(0, 210, 190, 0.2);
}

/* 內嵌編輯確認彈窗樣式 */
.change-summary {
    background-color: rgba(0, 210, 190, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #00d2be;
}

.change-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.change-item:last-child {
    margin-bottom: 0;
}

.change-label {
    font-weight: 600;
    color: var(--text-light, #e0e6ed);
    min-width: 60px;
    margin-right: 10px;
}

.change-old-value {
    color: #dc3545;
    background: rgba(239, 68, 68, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.change-new-value {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* 表格內下拉選單適配 */
.data-table td .inline-edit-select {
    min-width: 120px;
    max-width: 200px;
}

/* 特定欄位的寬度調整 - 減少40% */
.data-table .inline-edit-select[data-field="country"],
.data-table .inline-edit-select[data-field="agency"] {
    min-width: 72px;  /* 120px * 0.6 */
    max-width: 120px; /* 200px * 0.6 */
    width: 90px;      /* 固定寬度 */
}

/* 出帳方式欄位寬度調整 - 再減少15% (總共減少27.75%) */
.data-table .inline-edit-select[data-field="payout"] {
    min-width: 87px;  /* 102px * 0.85 */
    max-width: 145px; /* 170px * 0.85 */
    width: 116px;     /* 136px * 0.85 */
}

/* 幣別欄位寬度調整 - 減少40%後再加寬15%，與經紀欄位等寬 */
.data-table .inline-edit-select[data-field="currency"] {
    min-width: 72px;  /* 與經紀欄位相同 */
    max-width: 120px; /* 與經紀欄位相同 */
    width: 90px;      /* 與經紀欄位相同 */
}

/* 配置匯入預覽表格樣式 */
.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.preview-table th,
.preview-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.preview-table th {
    background-color: rgba(0, 210, 190, 0.1);
    font-weight: bold;
}

.preview-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.preview-table tbody tr:hover {
    background-color: rgba(0, 210, 190, 0.1);
}

.import-config-section {
    margin-bottom: 20px;
}

.import-options {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(0, 210, 190, 0.1);
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.import-options h4 {
    margin: 0 0 12px 0;
    color: var(--text-light, #e0e6ed);
    font-size: 16px;
    font-weight: 600;
}

.import-options label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    margin: 0 0 12px 0;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.import-options label:hover {
    background-color: rgba(0, 210, 190, 0.1);
}

.import-options label:last-child {
    margin-bottom: 0;
}

.duplicate-handling {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.duplicate-handling input[type="radio"] {
    margin: 0;
    flex-shrink: 0;
}

.duplicate-handling label {
    line-height: 1.4;
}

.help-text {
    color: var(--text-gray, #8892a6);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 配置選項下拉選單樣式 */
.config-dropdown-container {
    position: relative;
    display: inline-block;
}

.config-main-btn {
    position: relative;
    padding-right: 35px !important;
}

.dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.config-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

.config-dropdown-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: var(--bg-card);
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-white);
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.config-dropdown-btn:last-child {
    border-bottom: none;
}

.config-dropdown-btn:hover {
    background-color: rgba(0, 210, 190, 0.1);
    color: #00d2be;
}

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

/* 收款資料狀態樣式 */
.payment-status-loading {
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

.payment-status-success {
    color: #10b981;
    font-size: 1.2em;
    font-weight: bold;
}

.payment-status-success.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-status-success.clickable:hover {
    color: #1e7e34;
    transform: scale(1.1);
    text-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

.payment-status-warning {
    color: #ffc107;
    font-size: 1.2em;
    font-weight: bold;
}

.payment-status-warning.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-status-warning.clickable:hover {
    color: #e0a800;
    transform: scale(1.1);
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}

.payment-status-error {
    color: #dc3545;
    font-size: 1.2em;
    font-weight: bold;
}

/* 收款資料欄位樣式 */
[id^="payment-status-"] {
    text-align: center;
    cursor: help;
}

/* 匯入功能樣式 */
.import-instructions {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #00d2be;
    color: #1e293b !important;
}

.import-instructions h4 {
    color: #0277bd !important;
    margin-bottom: 10px;
}

.import-instructions p {
    color: #37474f !important;
}

.format-example {
    background: #cfd8dc;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 0.9em;
    word-break: break-all;
    color: #263238 !important;
}

.import-notes {
    color: #37474f !important;
}

.import-notes ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #37474f !important;
}

.import-notes li {
    color: #37474f !important;
}

.import-notes li strong {
    color: #1e293b;
    margin-bottom: 5px;
}

.file-upload-area {
    margin: 20px 0;
}

.upload-zone {
    border: 2px dashed #90a4ae;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #eceff1;
}

.upload-zone:hover {
    border-color: #00d2be;
    background: #e3f2fd;
}

.upload-zone.dragover {
    border-color: #00d2be;
    background: #bbdefb;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #546e7a;
}

.upload-text p {
    margin: 5px 0;
    color: #37474f !important;
}

.upload-text strong {
    color: #0277bd !important;
}

.upload-hint {
    color: #607d8b;
    font-size: 0.9em;
}

.file-info {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.file-info p {
    margin: 5px 0;
    color: #6ee7b7;
}

.import-preview {
    margin-top: 20px;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    margin-bottom: 10px;
}

.preview-table th,
.preview-table td {
    border: 1px solid #dee2e6;
    padding: 6px 8px;
    text-align: left;
}

.preview-table th {
    background-color: rgba(0, 210, 190, 0.1);
    font-weight: 600;
    color: var(--text-light, #e0e6ed);
}

.preview-table td {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-more {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 10px 0;
}

.preview-stats {
    background: #e3f2fd;
    border-radius: 4px;
    padding: 8px 12px;
    text-align: center;
    color: #1565c0;
    font-weight: 600;
}

/* 表單類型切換按鈕樣式 */
.form-type-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.form-type-switcher .btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: 2px solid transparent;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-type-switcher .btn.btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.form-type-switcher .btn.btn-secondary {
    background-color: #f8fafc;
    color: #64748b;
    border-color: var(--border-color);
}

.form-type-switcher .btn.btn-secondary:hover {
    background-color: var(--bg-card, #1a2332);
    border-color: #cbd5e1;
    color: #475569;
}

.form-type-switcher .btn.active {
    background-color: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* 語言切換按鈕樣式 */
.language-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-end;
}

.language-switcher .btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.language-switcher .btn:hover {
    background-color: var(--bg-card, #1a2332);
    border-color: #cbd5e1;
    color: #475569;
}

.language-switcher .btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.language-switcher .btn.btn-outline-primary {
    border-color: var(--border-color);
    background-color: #f8fafc;
    color: #64748b;
}

.language-switcher .btn.btn-outline-primary.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* 語言切換 - 電腦版按鈕（預設顯示） */
.language-switcher-desktop {
    display: flex;
}

/* 語言切換 - 手機版下拉選單（預設隱藏） */
.language-switcher-mobile {
    display: none;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.language-select-label {
    font-size: 20px;
    line-height: 1;
}

.language-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #f8fafc;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    min-width: 120px;
    transition: all 0.2s ease;
}

.language-select:hover {
    border-color: #3b82f6;
    background-color: var(--bg-card);
}

.language-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--bg-card);
}

/* 響應式切換：螢幕寬度小於 520px 時切換為下拉選單 */
@media (max-width: 520px) {
    .language-switcher-desktop {
        display: none;
    }
    
    .language-switcher-mobile {
        display: flex;
    }
}

/* ==================== 制度管理頁面樣式 ==================== */

.regulations-section {
    margin-bottom: 30px;
}

.regulations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(74, 124, 184, 0.3);
}

.regulations-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #ffffff;
}

.regulations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.regulation-card {
    background: linear-gradient(135deg, rgba(74, 124, 184, 0.15) 0%, rgba(91, 141, 201, 0.2) 100%);
    border: 1px solid rgba(74, 124, 184, 0.4);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.regulation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 210, 190, 0.2);
    border-color: #00d2be;
}

.regulation-card .regulation-card-icon {
    color: #ffffff !important;
}

.regulation-card .regulation-card-name {
    color: #ffffff !important;
}

.regulation-card .regulation-card-count {
    color: #a0b3cc !important;
}

.regulation-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.regulation-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light, #e0e6ed);
    text-align: center;
    margin-bottom: 5px;
}

.regulation-card .card-count {
    font-size: 0.85rem;
    color: var(--text-gray, #8892a6);
    text-align: center;
}

.regulation-card .card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    left: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.regulation-card:hover .card-actions {
    opacity: 1;
}

.regulation-card .card-actions button {
    padding: 3px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
    min-width: auto;
    white-space: nowrap;
}

/* 制度內容編輯彈窗 */
.regulation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.regulation-modal {
    background: var(--bg-card, #1a2332);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--primary-color, #00d2be);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.regulation-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0, 210, 190, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card-light, #212b3d);
}

.regulation-modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-white, #ffffff);
}

.regulation-modal-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light, #e0e6ed);
    padding: 5px;
    line-height: 1;
}

.regulation-modal-header .close-btn:hover {
    color: #ef4444;
}

.regulation-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-card, #1a2332);
    color: var(--text-light, #e0e6ed);
}

.regulation-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid rgba(0, 210, 190, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-card-light, #212b3d);
}

/* 制度彈窗內的輸入框樣式 */
.regulation-modal input,
.regulation-modal textarea {
    background: var(--bg-card-light, #212b3d);
    border: 1px solid rgba(0, 210, 190, 0.3);
    color: var(--text-light, #e0e6ed);
    border-radius: 6px;
    padding: 10px 12px;
    width: 100%;
    font-size: 14px;
}

.regulation-modal input:focus,
.regulation-modal textarea:focus {
    border-color: var(--primary-color, #00d2be);
    box-shadow: 0 0 0 3px rgba(0, 210, 190, 0.15);
    outline: none;
}

.regulation-modal label {
    color: var(--text-white, #ffffff);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* 統一匯出按鈕樣式 */
.action-btn.export,
.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-btn.export:hover,
.export-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* 統一操作列元素高度 */
.form-filters input,
.form-filters select,
.form-filters .btn,
.form-filters .action-btn {
    height: 38px;
    line-height: 38px;
    padding: 0 12px;
    box-sizing: border-box;
    border-radius: 6px;
    font-size: 14px;
}

.form-filters input {
    padding: 8px 12px;
    line-height: 1.4;
}

.form-filters select {
    padding: 8px 12px;
    line-height: 1.4;
}

/* 制度項目列表 */
.regulation-items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.regulation-item {
    background: var(--bg-card);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 15px;
}

.regulation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.regulation-item-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.regulation-item-content {
    color: #1e293b !important;
}

.regulation-item-actions {
    display: flex;
    gap: 8px;
}

.regulation-item-content {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 新增制度項目表單 */
.add-regulation-form {
    background: #f0f9ff;
    border: 2px dashed #3b82f6;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

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

.add-regulation-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #1e293b;
}

.add-regulation-form input,
.add-regulation-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
}

.add-regulation-form textarea {
    min-height: 120px;
    resize: vertical;
}

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

/* 載入佔位符 */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #64748b;
    grid-column: 1 / -1;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    grid-column: 1 / -1;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.empty-state p {
    margin-bottom: 15px;
}

/* ==================== 操作日誌頁面樣式 ==================== */

.audit-log-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid var(--border-color);
}

.audit-log-header h1 {
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 2.2rem;
}

.audit-log-header p {
    color: #64748b;
    font-size: 1.1rem;
    margin: 0;
}

.audit-search-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.audit-search-section h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-search-section .search-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.audit-search-section .filter-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    align-items: end;
}

.audit-search-section .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.audit-search-section .filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.audit-search-section .filter-group input,
.audit-search-section .filter-group select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.audit-search-section .filter-group input:focus,
.audit-search-section .filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.audit-search-section .filter-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.audit-search-section .filter-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-stats {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-unit {
    font-size: 0.85rem;
    opacity: 0.8;
}

.audit-table-container {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.table-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-controls select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-card);
}

.audit-table {
    width: 100%;
    margin: 0;
}

.audit-table th {
    background: var(--bg-card, #1a2332);
    color: #374151;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
}

.audit-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

.audit-table th.sortable:hover {
    background: var(--bg-card);
}

.sort-indicator {
    margin-left: 5px;
    font-size: 0.8rem;
    color: #6b7280;
}

.audit-table td {
    padding: 12px;
    border-bottom: 1px solid var(--bg-card, #1a2332);
    font-size: 0.9rem;
    vertical-align: middle;
}

.audit-table tr:hover {
    background: #f8fafc;
}

.audit-table tr.important-change {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.audit-table tr.important-change:hover {
    background: #fde68a;
}

.status-success {
    color: #059669;
    font-weight: 600;
}

.status-error {
    color: #dc2626;
    font-weight: 600;
}

.status-warning {
    color: #d97706;
    font-weight: 600;
}

.status-muted {
    color: #6b7280;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #6b7280;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-controls .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-numbers .btn {
    min-width: 36px;
    padding: 8px 10px;
    text-align: center;
}

.page-numbers .btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.no-data {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 40px 20px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .audit-search-section .filter-row {
        grid-template-columns: 1fr;
    }
    
    .audit-search-section .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .audit-search-section .filter-actions .btn {
        justify-content: center;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
    
    .audit-table {
        font-size: 0.8rem;
    }
    
    .audit-table th,
    .audit-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .audit-log-header h1 {
        font-size: 1.8rem;
    }
    
    .audit-search-section {
        padding: 15px;
    }
    
    .filter-group input,
    .filter-group select {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .audit-table {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* ==================== 創作者狀態切換按鈕樣式 ==================== */
.status-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    padding: 10px;
    background: transparent;
    border-radius: 8px;
    border: none;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid rgba(0, 210, 190, 0.3);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #e0e6ed;
    min-width: 120px;
    text-align: center;
}

.tab-btn:hover {
    background: rgba(0, 210, 190, 0.1);
    border-color: #00d2be;
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #00d2be 0%, #00a896 100%) !important;
    color: white !important;
    border-color: #00d2be !important;
    box-shadow: 0 2px 4px rgba(0, 210, 190, 0.3) !important;
}

.tab-btn.active:hover {
    background: linear-gradient(135deg, #00baa8 0%, #009688 100%) !important;
    border-color: #00baa8 !important;
}

/* ==================== 收款來源切換按鈕樣式 ==================== */
.source-toggle-group {
    display: flex;
    gap: 2px;
    background: var(--bg-card-light, #212b3d);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color, rgba(0, 210, 190, 0.3));
}

.source-toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--text-gray, #8892a6);
    min-width: 80px;
    text-align: center;
}

.source-toggle-btn:hover {
    background: rgba(0, 210, 190, 0.1);
    color: var(--text-white, #ffffff);
}

.source-toggle-btn.active {
    background: linear-gradient(135deg, #00d2be 0%, #00a896 100%) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 210, 190, 0.3) !important;
}

.source-toggle-btn.active:hover {
    background: linear-gradient(135deg, #00baa8 0%, #009688 100%) !important;
}

/* ==================== 表單確認彈窗樣式 ==================== */
.confirmation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.confirmation-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.confirmation-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.confirmation-modal-header h2 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 1.5rem;
}

.confirmation-modal-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.confirmation-modal-body {
    padding: 20px 30px;
    color: #1f2937;
}

.confirmation-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 彈窗中的按鈕樣式 - 確保文字顏色正確 */
.confirmation-modal-footer .btn-secondary {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
}

.confirmation-modal-footer .btn-secondary:hover {
    background: #e5e7eb !important;
    color: #1f2937 !important;
}

.confirmation-modal-footer .btn-primary {
    background: #3b82f6 !important;
    color: white !important;
    border: 1px solid #3b82f6 !important;
}

.confirmation-modal-footer .btn-primary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

.confirmation-modal-footer .btn-danger {
    background: #dc2626 !important;
    color: white !important;
    border: 1px solid #dc2626 !important;
}

.confirmation-modal-footer .btn-danger:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}

/* 響應式表格容器 - 統一使用收款資訊頁面的方式 */
.responsive-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: var(--bg-card);
}

.responsive-table {
    width: 100%;
    min-width: 1200px; /* 增加最小寬度，與收款資訊頁面一致 */
    border-collapse: collapse;
    font-size: 14px;
}

.responsive-table th,
.responsive-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap; /* 防止文字換行 */
    vertical-align: top; /* 確保所有欄位頂部對齊 */
}

.responsive-table th {
    background-color: rgba(0, 210, 190, 0.1);
    font-weight: 600;
    color: var(--text-light, #e0e6ed);
    position: sticky;
    top: 0;
    z-index: 10;
}

.responsive-table tbody tr:hover {
    background-color: rgba(0, 210, 190, 0.1);
}

/* 確保操作欄位的下拉選單不被裁切 */
.responsive-table td:last-child {
    overflow: visible;
    text-align: center;
    vertical-align: top; /* 與其他欄位保持一致的對齊方式 */
}

/* 操作欄位標題對齊 */
.responsive-table th:last-child {
    text-align: center;
}

/* 操作欄位內的按鈕容器 */
.responsive-table td:last-child .action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 60px; /* 增加最小高度確保一致 */
    justify-content: flex-start; /* 內容從頂部開始 */
}

/* 操作欄位內的時間戳記 */
.responsive-table td:last-child .submit-time {
    font-size: 0.8rem;
    color: var(--text-gray, #8892a6);
    margin-top: 4px;
    line-height: 1.2; /* 固定行高 */
}

/* 確保操作欄位的內容高度一致 */
.responsive-table td:last-child {
    overflow: visible;
    text-align: center;
    vertical-align: top; /* 與其他欄位保持一致的對齊方式 */
    min-height: 60px; /* 設定最小高度 */
    position: relative;
}

/* ==================== 多選操作按鈕樣式 ==================== */
.multi-action-btn {
    background: var(--bg-card, #1a2332);
    color: var(--text-light, #e0e6ed);
    border: 2px solid rgba(0, 210, 190, 0.3);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    display: none; /* 預設隱藏，有選中項目時顯示 */
}

.multi-action-btn:hover {
    background: rgba(0, 210, 190, 0.1);
    border-color: #00d2be;
}

.multi-action-btn.show {
    display: inline-block;
}

.multi-action-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card, #1a2332);
    border: 1px solid var(--border-color, rgba(0, 210, 190, 0.3));
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 200px;
    display: none;
}

.multi-action-dropdown.show {
    display: block;
}

.multi-action-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: var(--text-light, #e0e6ed);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.multi-action-dropdown button:hover {
    background: rgba(0, 210, 190, 0.1);
}

.multi-action-dropdown button:first-child {
    border-radius: 6px 6px 0 0;
}

.multi-action-dropdown button:last-child {
    border-radius: 0 0 6px 6px;
}

/* 基礎響應式設計 - 確保所有元素適應容器 */
.creator-filters {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 配置彈窗基礎樣式 */
#configModal {
    overflow: hidden; /* 防止背景滾動 */
}

#configModal[style*="display: block"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#configModal .modal-content {
    max-width: 800px;
    max-height: 90vh; /* 改為90vh確保不會超出螢幕 */
    height: auto;
    min-height: 60vh;
    width: 90%;
    margin: 0 !important; /* 移除自動邊距，使用flex居中 */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止整個modal-content滾動 */
    position: relative; /* 確保定位正確 */
}

#configModal .modal-header {
    flex-shrink: 0; /* 標題區域不收縮 */
    padding: 20px 20px 15px 20px;
    margin: 0;
}

#configModal .modal-body {
    flex: 1;
    overflow-y: auto; /* 只有body區域可以滾動 */
    padding: 0 20px 20px 20px;
    min-height: 0; /* 允許flex子項目收縮 */
}

/* 大螢幕配置項目優化 - 充分利用增加的彈窗高度 */
@media (min-width: 1201px) {
    #configModal .modal-content {
        max-width: 800px !important;
        max-height: 95vh !important; /* 調整為95vh避免超出螢幕 */
        min-height: 70vh !important;
    }
    
    .config-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 18px;
    }
    
    .config-item-card {
        padding: 15px 18px;
    }
}

/* 超大螢幕優化 */
@media (min-width: 1400px) {
    .config-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }
}

.search-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    box-sizing: border-box;
}

.filter-selects {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.filter-select {
    width: 100%;
    box-sizing: border-box;
}

/* 配置彈窗響應式設計 */
@media (max-width: 1200px) {
    #configModal .modal-content {
        max-width: 90vw !important;
        max-height: 90vh !important;
        min-height: 60vh !important;
        margin: 0 !important; /* 確保沒有邊距 */
    }
    
    .config-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    #configModal .modal-content {
        max-width: 95vw !important;
        max-height: 90vh !important;
        min-height: 50vh !important;
        margin: 0 !important; /* 確保沒有邊距 */
    }
    
    .config-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .config-actions input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 創作者篩選區域響應式 */
    .creator-filters {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .search-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .search-input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .filter-selects {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .filter-select {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .config-items-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .config-item-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .config-item-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .config-items-grid {
        gap: 8px;
    }
    
    .config-item-card {
        padding: 8px 12px;
    }
    
    .config-item-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .config-edit-btn,
    .config-delete-btn {
        width: 100%;
        text-align: center;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .status-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        min-width: auto;
        width: 100%;
    }
    
    /* 小螢幕表格優化 - 與收款資訊頁面一致 */
    .responsive-table {
        min-width: 1000px; /* 保持較大的最小寬度確保完整顯示 */
        font-size: 12px;
    }
    
    .responsive-table th,
    .responsive-table td {
        padding: 8px 6px;
    }
    
    /* 確保表格容器在小螢幕上可滾動 */
    .responsive-table-container {
        margin: 0 -15px; /* 延伸到容器邊緣，與收款資訊頁面一致 */
        border-radius: 0;
        box-shadow: none; /* 小螢幕時移除陰影 */
    }
}

@media (max-width: 480px) {
    .responsive-table {
        min-width: 800px; /* 手機端仍保持足夠寬度 */
        font-size: 11px;
    }
    
    .responsive-table th,
    .responsive-table td {
        padding: 6px 4px;
    }
    
    .responsive-table-container {
        margin: 0 -20px; /* 手機端延伸更多 */
    }
}

/* 虛擬滾動相關樣式 */
.virtual-scroll-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: var(--bg-card);
    overflow: hidden;
}

/* 固定的表頭區域 */
.virtual-scroll-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 2px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden; /* 隱藏滾動條，但允許 JS 控制 scrollLeft */
    width: 100%;
}

.virtual-scroll-header-inner {
    overflow-x: scroll; /* 必須是 scroll 或 auto 才能設定 scrollLeft */
    overflow-y: hidden; /* 隱藏垂直滾動 */
    scrollbar-width: none; /* Firefox 隱藏滾動條 */
    -ms-overflow-style: none; /* IE/Edge 隱藏滾動條 */
    width: 100%;
}

.virtual-scroll-header-inner::-webkit-scrollbar {
    display: none; /* Chrome/Safari 隱藏滾動條 */
}

.virtual-scroll-header .responsive-table {
    margin-bottom: 0;
    table-layout: auto;
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
}

.virtual-scroll-header thead th {
    background-color: rgba(0, 210, 190, 0.1);
    font-weight: 600;
    border-bottom: none;
    text-align: left;
    padding: 10px 12px;
    vertical-align: middle;
}

/* 可滾動的表身區域 */
.virtual-scroll-wrapper {
    background: var(--bg-card);
}

.virtual-scroll-wrapper::-webkit-scrollbar {
    width: 12px;
}

.virtual-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.virtual-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.virtual-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.virtual-scroll-spacer {
    pointer-events: none;
    min-width: max-content;
}

.virtual-scroll-body-container {
    pointer-events: all;
    min-width: max-content;
}

#virtualTableContainer {
    will-change: transform;
    min-width: max-content;
}

/* 確保表頭和表身的表格使用相同的佈局 */
.virtual-scroll-container .responsive-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.virtual-scroll-container .responsive-table th,
.virtual-scroll-container .responsive-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 80px;
    text-align: left;
    padding: 10px 12px;
    box-sizing: border-box;
    vertical-align: middle;
}

/* 統一創作者總表的欄位寬度 */
.virtual-scroll-container .responsive-table th:nth-child(1),
.virtual-scroll-container .responsive-table td:nth-child(1) { min-width: 100px; } /* 加入時間/停權日期 */
.virtual-scroll-container .responsive-table th:nth-child(2),
.virtual-scroll-container .responsive-table td:nth-child(2) { min-width: 90px; }  /* ID/當月月底 */
.virtual-scroll-container .responsive-table th:nth-child(3),
.virtual-scroll-container .responsive-table td:nth-child(3) { min-width: 120px; } /* UID/次月月底 */
.virtual-scroll-container .responsive-table th:nth-child(4),
.virtual-scroll-container .responsive-table td:nth-child(4) { min-width: 80px; }  /* 姓名 */
.virtual-scroll-container .responsive-table th:nth-child(5),
.virtual-scroll-container .responsive-table td:nth-child(5) { min-width: 60px; }  /* 國家 */
.virtual-scroll-container .responsive-table th:nth-child(6),
.virtual-scroll-container .responsive-table td:nth-child(6) { min-width: 80px; }  /* 起始合約 */
.virtual-scroll-container .responsive-table th:nth-child(7),
.virtual-scroll-container .responsive-table td:nth-child(7) { min-width: 100px; } /* 身份字號 */
.virtual-scroll-container .responsive-table th:nth-child(8),
.virtual-scroll-container .responsive-table td:nth-child(8) { min-width: 120px; } /* 經紀/推薦人 */

/* 操作欄位需要更多空間來顯示按鈕 */
.virtual-scroll-container .responsive-table td[id^="actions-"] {
    min-width: 200px;
    white-space: nowrap;
    overflow: visible;
}

.loading-more-indicator {
    color: var(--text-gray, #8892a6);
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* BQ 刷新通知動畫 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== Tooltip 樣式 ==================== */
.td-tooltip {
    position: relative;
    cursor: pointer;
}

/* Tooltip 文字 - 使用 fixed 定位，顯示在該行上方 */
.td-tooltip .tooltip-text {
    display: none; /* 預設隱藏，由 JS 控制 */
    visibility: hidden;
    position: fixed;
    z-index: 99999;
    background-color: var(--text-white);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    pointer-events: none; /* 確保不會干擾滑鼠事件 */
    /* 🔧 防止 tooltip 被選中和複製 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 🔧 顯示在上方時的向下箭頭（指向左側，對齊單元格） */
.td-tooltip .tooltip-text.tooltip-top::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px; /* 箭頭靠左對齊 */
    border-width: 8px;
    border-style: solid;
    border-color: var(--text-white) transparent transparent transparent;
}

/* 🔧 顯示在下方時的向上箭頭 */
.td-tooltip .tooltip-text.tooltip-bottom::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px; /* 箭頭靠左對齊 */
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent var(--text-white) transparent;
}

/* 長內容換行 */
.td-tooltip .tooltip-text.tooltip-multiline {
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 400px;
}

/* 表格行 hover 效果（淺灰色背景） */
.data-table tbody tr:hover {
    background-color: rgba(0, 210, 190, 0.1);
}

/* 收款資訊管理 - 分行欄位寬度縮小（台幣_個人的第5欄是分行） */
#adminPage .data-table th:nth-child(5),
#adminPage .data-table td:nth-child(5) {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 可搜尋下拉選單樣式 ==================== */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-trigger {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: var(--bg-card);
    font-size: 14px;
    color: var(--text-light, #e0e6ed);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 42px;
}

.searchable-select-trigger:hover {
    border-color: #adb5bd;
}

.searchable-select-trigger:focus,
.searchable-select-trigger.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

.searchable-select-trigger::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.2s;
}

.searchable-select-trigger.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-select-trigger .placeholder {
    color: #adb5bd;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: none;
    max-height: 300px;
    overflow: hidden;
}

.searchable-select-dropdown.show {
    display: block;
}

.searchable-select-search {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    background-color: rgba(0, 210, 190, 0.1);
}

.searchable-select-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.searchable-select-search input:focus {
    border-color: var(--primary-color);
}

.searchable-select-search input::placeholder {
    color: #adb5bd;
}

.searchable-select-options {
    max-height: 220px;
    overflow-y: auto;
}

.searchable-select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 14px;
    color: var(--text-light, #e0e6ed);
    border-bottom: 1px solid #f1f3f4;
}

.searchable-select-option:last-child {
    border-bottom: none;
}

.searchable-select-option:hover {
    background-color: rgba(0, 210, 190, 0.1);
}

.searchable-select-option.selected {
    background-color: var(--primary-color);
    color: #fff;
}

.searchable-select-option.no-results {
    color: #adb5bd;
    font-style: italic;
    cursor: default;
}

.searchable-select-option.no-results:hover {
    background-color: transparent;
}

/* 搜尋匹配高亮 */
.searchable-select-option mark {
    background-color: rgba(245, 158, 11, 0.8);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* ==================== 內嵌可搜尋下拉選單樣式 ==================== */
.inline-select-cell {
    min-width: 100px;
}

.inline-select-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.inline-select-wrapper:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 210, 190, 0.1);
}

.inline-select-display {
    font-size: 13px;
    color: #e0e6ed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.inline-select-arrow {
    font-size: 8px;
    color: #6c757d;
    margin-left: 6px;
}

/* 內嵌選擇彈窗 */
.inline-select-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.2s ease;
}

.inline-select-modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease;
}

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

.inline-select-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 210, 190, 0.2);
}

.inline-select-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
}

.inline-select-modal-close {
    font-size: 24px;
    color: #adb5bd;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.inline-select-modal-close:hover {
    color: #ffffff;
}

.inline-select-modal-search {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 210, 190, 0.2);
    background: #212b3d;
}

.inline-select-modal-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0, 210, 190, 0.3);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #1a2332;
    color: #e0e6ed;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inline-select-modal-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.inline-select-modal-options {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.inline-select-modal-option {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 14px;
    color: #e0e6ed;
}

.inline-select-modal-option:hover {
    background-color: rgba(0, 210, 190, 0.1);
}

.inline-select-modal-option.selected {
    background-color: var(--primary-color);
    color: #fff;
}

.inline-select-modal-option.selected:hover {
    background-color: #5a6fd6;
}

.inline-select-modal-option mark {
    background-color: rgba(245, 158, 11, 0.8);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== 收款資料來源切換（個人/經紀）===== */
.page-title-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.page-title-with-toggle h2 {
    margin: 0;
}

.source-toggle-group {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

.source-toggle-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: var(--bg-card);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.source-toggle-btn:first-child {
    border-right: 1px solid var(--primary-color);
}

.source-toggle-btn:hover:not(.active) {
    background: #f0f4ff;
}

.source-toggle-btn.active {
    background: var(--primary-color);
    color: #fff;
}

