/* BOYSKK 專用樣式 */

/* 全屏頁面 */
.bk-fullscreen-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f5f5f5;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 全屏頁面打開時隱藏底層滾動 */
body:has(.bk-fullscreen-page) {
  overflow: hidden;
}

.bk-fullscreen-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  flex-shrink: 0;
}

.bk-fullscreen-header h2 {
  flex: 1;
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.bk-fullscreen-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* 批量處理中心的可滾動內容區 */
.bk-batch-scroll {
  flex: 1;
  overflow-y: auto;
}

/* 表單區塊 */
.bk-form-section {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.bk-form-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 0.75rem;
}

.bk-form-group {
  margin-bottom: 1rem;
}

.bk-form-group label,
.bk-form-section > label {
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.bk-form-group input,
.bk-form-group select,
.bk-form-section input[type="text"],
.bk-form-section select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.bk-form-group input:focus,
.bk-form-section input:focus,
.bk-form-section select:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 2px rgba(33,150,243,0.1);
}

.bk-hint {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 1rem 0;
}

.bk-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.bk-form-col {
  display: flex;
  flex-direction: column;
}

.bk-radio-group {
  display: flex;
  gap: 1.5rem;
  margin: 0.5rem 0 1rem 0;
}

.bk-radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: normal;
}

/* 導入面板 */
.bk-import-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.bk-select-count {
  margin-left: auto;
  font-weight: 600;
  color: #2196F3;
}

.bk-import-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 2rem;
}

.bk-import-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background: #fff;
  transition: all 0.2s;
}

.bk-import-item:hover {
  border-color: #2196F3;
  box-shadow: 0 2px 8px rgba(33,150,243,0.1);
}

.bk-import-checkbox {
  display: flex;
  align-items: flex-start;
  padding-top: 0.25rem;
}

.bk-import-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.bk-import-info {
  flex: 1;
}

.bk-import-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.bk-import-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.bk-import-meta span {
  padding: 0.2rem 0.5rem;
  background: #f0f0f0;
  border-radius: 3px;
}

.bk-import-url {
  font-size: 0.85rem;
  color: #2196F3;
  word-break: break-all;
}

/* 批量處理面板 */
.bk-badge-done    { background: #e8f5e9; color: #2e7d32; padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }
.bk-badge-partial { background: #fff8e1; color: #f57f17; padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }
.bk-badge-fail    { background: #ffebee; color: #c62828; padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }
.bk-badge-pending { background: #e3f2fd; color: #1565c0; padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }

.bk-batch-log {
  margin: 1rem 2rem;
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
}

.bk-batch-log-title {
  padding: 0.6rem 1rem;
  background: #333;
  color: #ccc;
  font-size: 0.85rem;
  font-weight: 600;
}

.bk-batch-log pre {
  margin: 0;
  padding: 1rem;
  color: #d4d4d4;
  font-size: 0.8rem;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.bk-batch-results {
  margin: 1rem 2rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.bk-batch-result-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.bk-batch-result-item:last-child { border-bottom: none; }

.bk-step-badge {
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bk-step-badge.ok   { background: #e8f5e9; color: #2e7d32; }
.bk-step-badge.fail { background: #ffebee; color: #c62828; }

/* btn-warning */
.btn-warning {
  background: #ff9800;
  color: #fff;
  border: none;
}
.btn-warning:hover { background: #f57c00; }

.btn.disabled, .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 視頻上傳進度條 */
.bk-upload-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 8px;
}
.bk-progress-bar {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}
.bk-progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 4px;
  transition: width 0.2s ease;
}
.bk-progress-text {
  font-size: 12px;
  color: #555;
  white-space: nowrap;
}

/* 上傳狀態提示 */
.bk-upload-status {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.bk-upload-status.ok { background: #f0fdf4; color: #166534; }
.bk-upload-status.err { background: #fef2f2; color: #991b1b; }
.bk-upload-status.info { background: #eff6ff; color: #1e40af; }

/* 封面貼上區域 */
.bk-cover-paste-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.bk-cover-paste-zone:focus {
  border-color: #2563eb;
  background: #eff6ff;
}
.bk-paste-hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
}

/* Toast 提示 */
.bk-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  color: #fff;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  max-width: 400px;
  word-break: break-all;
}
.bk-toast.show { opacity: 1; transform: translateY(0); }
.bk-toast.success { background: #16a34a; }
.bk-toast.error { background: #dc2626; }
.bk-toast.info { background: #2563eb; }

/* 列表勾選框 */
.bk-post-checkbox {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
  margin-right: 8px;
}
.bk-post-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.bk-post-head {
  display: flex;
  align-items: flex-start;
}
/* 工具欄 flex */
.bk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 批量處理分階段按鈕 */
.bk-batch-actions {
  padding: 1rem 2rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}
.bk-batch-phase-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bk-batch-phase-btns .btn {
  flex: 1;
  min-width: 180px;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
}
.bk-batch-attention {
  margin: 0.5rem 2rem;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  overflow: hidden;
}
.bk-batch-attention .bk-batch-log-title {
  background: #fff3cd;
  color: #856404;
}
.bk-batch-attention .bk-batch-result-item {
  background: #fffde7;
}

/* 批量導入視頻 */
.btn-info {
  background: #2196F3;
  color: #fff;
  border: none;
}
.btn-info:hover {
  background: #1976D2;
}

.bk-batch-upload-zone {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px dashed #ccc;
  border-radius: 8px;
  background: #fafafa;
}

.bk-batch-upload-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}

.bk-batch-upload-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
}

.bk-batch-upload-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}


/* 編輯面板封面區域 */
.bk-edit-body .bk-cover-paste-zone {
  margin-top: 4px;
  padding: 12px;
}
.bk-edit-body label {
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin: 0.8rem 0 0.3rem 0;
  font-weight: 500;
}
.bk-edit-body label:first-child {
  margin-top: 0;
}

/* ============================================================
   階段進度卡片
   ============================================================ */
.bk-phase-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f5f5f5;
}
.bk-phase-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bk-phase-card.bk-phase-waiting {
  opacity: 0.55;
}
.bk-phase-card.bk-phase-running {
  border-color: #2196F3;
  box-shadow: 0 0 0 2px rgba(33,150,243,0.15);
}
.bk-phase-card.bk-phase-done {
  border-color: #4caf50;
}
.bk-phase-card.bk-phase-partial {
  border-color: #ff9800;
}
.bk-phase-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.bk-phase-icon {
  font-size: 18px;
}
.bk-phase-label {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}
.bk-phase-status-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eee;
  color: #666;
}
.bk-phase-running .bk-phase-status-tag {
  background: #e3f2fd;
  color: #1565c0;
  animation: bk-pulse 1.5s infinite;
}
.bk-phase-done .bk-phase-status-tag {
  background: #e8f5e9;
  color: #2e7d32;
}
.bk-phase-partial .bk-phase-status-tag {
  background: #fff3e0;
  color: #e65100;
}
@keyframes bk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.bk-phase-count {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.bk-phase-fail-count {
  color: #f44336;
  font-size: 14px;
  margin-left: 8px;
}
.bk-phase-bar-wrap {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.bk-phase-bar {
  height: 100%;
  background: #2196F3;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.bk-phase-done .bk-phase-bar {
  background: #4caf50;
}
.bk-phase-partial .bk-phase-bar {
  background: #ff9800;
}
.bk-phase-pct {
  font-size: 12px;
  color: #888;
}
.bk-phase-current {
  font-size: 12px;
  color: #555;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 日誌折疊 */
.bk-log-details {
  margin: 8px 24px 16px;
}
.bk-log-summary {
  cursor: pointer;
  font-size: 13px;
  color: #666;
  padding: 6px 0;
  user-select: none;
}
.bk-log-summary:hover {
  color: #333;
}
