/* ==================== 公佈欄樣式 (bulletin.css) ==================== */
/* 從 BulletinTab.html <style> 遷移 */

/* ===== 月份選擇列 ===== */
#bulletinTab .blt-month-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
#bulletinTab .blt-month-nav {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,122,255,0.1);
  color: #007AFF;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
#bulletinTab .blt-month-nav:hover {
  background: rgba(0,122,255,0.2);
}
#bulletinTab .blt-month-label {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  min-width: 120px;
  text-align: center;
}
#bulletinTab .blt-month-today {
  padding: 6px 14px;
  border: 1px solid rgba(0,122,255,0.3);
  border-radius: 20px;
  background: transparent;
  color: #007AFF;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
#bulletinTab .blt-month-today:hover {
  background: rgba(0,122,255,0.08);
}

/* ===== 部門子頁籤 ===== */
#bulletinTab .blt-dept-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
  scrollbar-width: none;
}
#bulletinTab .blt-dept-tabs::-webkit-scrollbar {
  display: none;
}
#bulletinTab .blt-dept-tab {
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  background: rgba(0,0,0,0.05);
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
#bulletinTab .blt-dept-tab:hover {
  background: rgba(0,122,255,0.08);
}
#bulletinTab .blt-dept-tab.active {
  background: linear-gradient(180deg, #007AFF 0%, #0051D5 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}
#bulletinTab .blt-dept-tab {
  position: relative;
}
#bulletinTab .blt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #FF3B30;
  color: white;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  line-height: 1;
  vertical-align: middle;
}
#bulletinTab .blt-dept-tab.active .blt-badge {
  background: rgba(255,255,255,0.9);
  color: #007AFF;
}

/* ===== 工具列（編輯模式切換） ===== */
#bulletinTab .blt-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  gap: 8px;
}
#bulletinTab .blt-edit-toggle {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(0,122,255,0.3);
  background: transparent;
  color: #007AFF;
}
#bulletinTab .blt-edit-toggle.active {
  background: #007AFF;
  color: white;
  border-color: #007AFF;
}

/* ===== 類別卡片 ===== */
#bulletinTab .blt-category-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  overflow: hidden;
}
#bulletinTab .blt-category-header {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#bulletinTab .blt-collapse-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 12px;
  color: #86868b;
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 6px;
}
#bulletinTab .blt-category-card.collapsed .blt-collapse-icon {
  transform: rotate(-90deg);
}
#bulletinTab .blt-category-body {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
#bulletinTab .blt-category-card.collapsed .blt-category-body {
  max-height: 0;
}
#bulletinTab .blt-category-card.collapsed .blt-category-header {
  border-bottom: none;
}
#bulletinTab .blt-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #FF3B30;
  color: white;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  margin-left: 4px;
}
#bulletinTab .blt-cat-promo .blt-category-header {
  background: linear-gradient(135deg, rgba(0,122,255,0.08) 0%, rgba(0,122,255,0.03) 100%);
}
#bulletinTab .blt-cat-target .blt-category-header {
  background: linear-gradient(135deg, rgba(52,199,89,0.08) 0%, rgba(52,199,89,0.03) 100%);
}
#bulletinTab .blt-cat-notice .blt-category-header {
  background: linear-gradient(135deg, rgba(255,149,0,0.08) 0%, rgba(255,149,0,0.03) 100%);
}
#bulletinTab .blt-cat-training .blt-category-header {
  background: linear-gradient(135deg, rgba(88,86,214,0.08) 0%, rgba(88,86,214,0.03) 100%);
}
#bulletinTab .blt-category-title {
  font-size: 17px;
  font-weight: 700;
  color: #0051D5;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
}
#bulletinTab .blt-category-count {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.06);
  color: #86868b;
  font-weight: 500;
}
#bulletinTab .blt-add-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,122,255,0.1);
  color: #007AFF;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
#bulletinTab .blt-edit-mode .blt-add-btn {
  display: flex;
}
#bulletinTab .blt-add-btn:hover {
  background: rgba(0,122,255,0.2);
}

/* ===== 公告項目 ===== */
#bulletinTab .blt-item {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
#bulletinTab .blt-item:last-child {
  border-bottom: none;
}
#bulletinTab .blt-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
#bulletinTab .blt-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #3a3a3c;
  flex: 1;
}
#bulletinTab .blt-item-actions {
  display: none;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}
#bulletinTab .blt-edit-mode .blt-item-actions {
  display: flex;
}
#bulletinTab .blt-item-actions button {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
#bulletinTab .blt-btn-edit {
  background: rgba(0,122,255,0.1);
  color: #007AFF;
}
#bulletinTab .blt-btn-delete {
  background: rgba(255,59,48,0.1);
  color: #FF3B30;
}
#bulletinTab .blt-item-content {
  font-size: 14px;
  color: #3a3a3c;
  line-height: 1.7;
}
#bulletinTab .blt-item-content ul,
#bulletinTab .blt-item-content ol {
  margin: 4px 0;
  padding-left: 20px;
}
#bulletinTab .blt-item-content li {
  margin-bottom: 2px;
}
#bulletinTab .blt-item-meta {
  font-size: 12px;
  color: #86868b;
  margin-top: 8px;
  line-height: 1.6;
}
#bulletinTab .blt-item-meta .blt-meta-edited {
  color: #007AFF;
}

/* ===== 已刪除項目（刪除線） ===== */
#bulletinTab .blt-item-deleted {
  opacity: 0.6;
  background: rgba(0,0,0,0.02);
}
#bulletinTab .blt-item-deleted .blt-item-title {
  text-decoration: line-through;
  color: #86868b;
}
#bulletinTab .blt-item-deleted .blt-item-content {
  text-decoration: line-through;
  color: #aeaeb2;
}
#bulletinTab .blt-item-deleted .blt-item-meta {
  color: #FF3B30;
}
#bulletinTab .blt-btn-restore {
  background: rgba(52,199,89,0.1);
  color: #34C759;
}
#bulletinTab .blt-btn-restore:hover {
  background: rgba(52,199,89,0.2);
}

/* ===== 空狀態 ===== */
#bulletinTab .blt-empty {
  text-align: center;
  padding: 24px 16px;
  color: #86868b;
  font-size: 14px;
}
#bulletinTab .blt-empty-global {
  text-align: center;
  padding: 60px 20px;
}
#bulletinTab .blt-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
#bulletinTab .blt-empty-text {
  font-size: 16px;
  color: #86868b;
  font-weight: 500;
}

/* ===== 載入中 ===== */
#bulletinTab .blt-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
}
#bulletinTab .blt-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(0,122,255,0.2);
  border-top: 3px solid #007AFF;
  border-radius: 50%;
  animation: bltSpin 0.8s linear infinite;
}
@keyframes bltSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== 編輯 Modal ===== */
#bulletinTab .blt-editor-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #f5f5f7;
  border-radius: 10px;
}
#bulletinTab .blt-editor-toolbar button {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
#bulletinTab .blt-editor-toolbar button:hover {
  background: rgba(0,122,255,0.1);
  color: #007AFF;
}
#bulletinTab .blt-textarea {
  width: 100%;
  min-height: 200px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
}
#bulletinTab .blt-textarea:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 4px rgba(0,122,255,0.1);
}

/* ===== 手機適配 ===== */
@media (max-width: 767.98px) {
  #bulletinTab .blt-month-bar {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
  }
  #bulletinTab .blt-month-label {
    font-size: 15px;
    min-width: 100px;
  }
  #bulletinTab .blt-dept-tab {
    padding: 7px 14px;
    font-size: 13px;
  }
  #bulletinTab .blt-category-card {
    border-radius: 14px;
    margin-bottom: 12px;
  }
  #bulletinTab .blt-category-header {
    padding: 12px 16px;
  }
  #bulletinTab .blt-item {
    padding: 12px 16px;
  }
  #bulletinTab .blt-textarea {
    min-height: 160px;
  }
}
