:root {
  --bg-main: #090d16;
  --bg-card: rgba(18, 26, 44, 0.75);
  --bg-card-hover: rgba(28, 39, 65, 0.85);
  --bg-input: rgba(10, 16, 28, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --primary-hover: #4f46e5;
  
  --douyin-pink: #fe2c55;
  --douyin-cyan: #25f4ee;
  --bili-blue: #00a1d6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(254, 44, 85, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 85%, rgba(0, 161, 214, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pro {
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: #fff;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  background: rgba(10, 15, 26, 0.6);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.tab-label-short {
  display: none;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 12px var(--primary-glow);
}

.task-count-badge {
  background: var(--douyin-pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  padding: 12px 24px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 12px 24px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-banner {
  text-align: center;
  margin: 16px 0 24px 0;
}

.hero-banner h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.hero-banner p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Input Card */
.input-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.url-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 10px 6px 16px;
  gap: 12px;
  transition: var(--transition);
}

.url-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-icon {
  color: var(--text-muted);
  font-size: 16px;
}

.url-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
}

.url-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-full);
  display: none;
}

.btn-clear:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.btn-paste {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Input Card Footer & Tips */
.input-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 4px;
}

.input-card-tips {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.input-card-tips i {
  font-size: 14px;
}

/* Official Platform Showcase Bar */
.platform-showcase-container {
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.4s ease;
}

.platform-showcase-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}

.showcase-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.showcase-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.showcase-title i {
  color: #6366f1;
}

.platform-showcase-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.platform-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.platform-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2.5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.platform-icon-wrapper {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.platform-brand-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.platform-item:hover .platform-brand-icon {
  transform: scale(1.15);
}

.platform-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.platform-item:hover .platform-name {
  color: #ffffff;
}

.badge-brand-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
  margin-right: 4px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Preview Card */
.preview-container {
  margin-top: 24px;
}

.preview-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
}

.preview-media-col {
  display: flex;
  flex-direction: column;
}

.media-thumb-box {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.media-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: #fff;
  backdrop-filter: blur(8px);
}

.media-badge.douyin {
  background: rgba(254, 44, 85, 0.85);
}

.media-badge.bilibili {
  background: rgba(0, 161, 214, 0.85);
}

.media-badge.hongguo {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.media-badge.kuaikaw {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.media-badge.kuaishou {
  background: linear-gradient(135deg, #ff5000, #ff8c00);
}

.media-badge.xingya {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.media-badge.xiaohongshu {
  background: linear-gradient(135deg, #ff2442, #e01734);
}

.media-badge.ixigua {
  background: linear-gradient(135deg, #fd2d55, #f85959);
}

.media-badge.youtube {
  background: linear-gradient(135deg, #ff0000, #cc0000);
}

.media-badge.tiktok {
  background: linear-gradient(135deg, #00f2fe, #fe2c55);
}

.media-badge.facebook {
  background: linear-gradient(135deg, #1877f2, #0d65d9);
}

.media-badge.twitter {
  background: linear-gradient(135deg, #1d9bf0, #0c7abf);
}

.media-badge.instagram {
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
}

.media-badge.reddit {
  background: linear-gradient(135deg, #ff4500, #d03700);
}

.media-badge.pinterest {
  background: linear-gradient(135deg, #e60023, #ad081b);
}

.media-badge.threads {
  background: linear-gradient(135deg, #1f2937, #111827);
}

.duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
}

.preview-info-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.author-details h4 {
  font-size: 15px;
  font-weight: 700;
}

.platform-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.media-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.format-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.format-name {
  font-size: 0.88rem !important;
  font-weight: 600;
  color: #f1f5f9;
  white-space: normal !important;
  line-height: 1.3;
}

.format-option-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.format-option-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.format-option-card.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.format-option-icon {
  font-size: 18px;
  color: var(--primary);
}

.format-option-details {
  display: flex;
  flex-direction: column;
}

.format-option-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.format-option-tag {
  font-size: 11px;
  color: var(--text-secondary);
}

.preview-action-row {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Batch Pane */
.batch-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.card-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.card-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.batch-mode-selector {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.mode-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.mode-radio input:checked + span {
  color: var(--primary);
  font-weight: 600;
}

.batch-textarea-wrapper textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

.batch-textarea-wrapper textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.batch-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.url-counter {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Tasks & History Pane */
.tasks-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.tasks-header-bar h3 {
  font-size: 20px;
  font-weight: 700;
}

.tasks-header-bar p {
  font-size: 13px;
  color: var(--text-secondary);
}

.tasks-filter-group {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.filter-chip {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-chip.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.task-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: #000;
  object-fit: cover;
  flex-shrink: 0;
}

.task-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-platform-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.task-platform-badge.douyin { background: var(--douyin-pink); }
.task-platform-badge.bilibili { background: var(--bili-blue); }

.task-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.task-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--douyin-cyan));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.task-card.completed .task-progress-bar-fill {
  background: var(--success);
}

.task-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Settings Pane */
.settings-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-card h3 {
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-info label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-info p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.setting-control-row {
  display: flex;
  gap: 10px;
}

.form-control {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
}

.setting-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
}

.setting-status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 800px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.25s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .preview-card {
    grid-template-columns: 1fr;
  }
  .media-thumb-box {
    max-height: 240px;
  }
  .navbar {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-tabs {
    overflow-x: auto;
  }
}


/* ==========================================================================
   CHANNEL & BATCH VIDEO GRID STYLES
   ========================================================================== */

.channel-preview-container {
  margin-top: 24px;
  width: 100%;
}

.channel-preview-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.channel-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.channel-author-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.channel-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  border: 2px solid var(--douyin-pink);
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(254, 44, 85, 0.25);
}

.channel-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.video-count-pill {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.channel-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.channel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(10, 16, 28, 0.6);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.channel-select-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.channel-stats-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.text-highlight {
  color: var(--success);
  font-weight: 700;
}

/* Video Grid */
.channel-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 6px;
}

.channel-video-grid::-webkit-scrollbar {
  width: 6px;
}

.channel-video-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

.channel-video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}

.channel-video-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.channel-video-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.card-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.card-thumb-wrapper {
  position: relative;
  width: 90px;
  height: 125px; /* Chuẩn tỷ lệ Poster dọc 3:4 của Douyin */
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; background: #0f172a; }

.channel-video-card:hover .card-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; background: #0f172a; }

.card-stt-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.card-info-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.card-id-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-link-btn {
  color: var(--primary);
  font-size: 0.8rem;
  transition: var(--transition);
}

.card-link-btn:hover {
  color: #818cf8;
}


/* ==========================================================================
   CHANNEL MONITOR & AUTO DOWNLOADER STYLES (v4.4)
   ========================================================================== */

.monitored-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.channel-monitor-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.channel-monitor-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.15);
}

.channel-monitor-card.inactive {
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.04);
}

.monitor-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.monitor-avatar-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.monitor-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(99, 102, 241, 0.5);
  background: #1e293b;
}

.monitor-platform-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
  border: 1.5px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.monitor-platform-icon.douyin {
  color: #ff0050;
}

.monitor-platform-icon.bilibili {
  color: #00aeec;
}

.monitor-card-info {
  flex: 1;
  min-width: 0;
}

.monitor-channel-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-stats-row {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.monitor-stats-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.monitor-stats-badge.highlight {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.monitor-card-body {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.monitor-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
}

.monitor-detail-item i {
  width: 14px;
  text-align: center;
  color: #64748b;
}

.monitor-detail-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  margin-top: auto;
}

/* Custom Switch Toggle */
.monitor-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.monitor-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  background-color: #334155;
  border-radius: 20px;
  transition: 0.3s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.monitor-switch input:checked + .switch-slider {
  background-color: #10b981;
}

.monitor-switch input:checked + .switch-slider:before {
  transform: translateX(18px);
}

.monitor-btn-group {
  display: flex;
  gap: 6px;
}

.btn-icon-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-icon-sm:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.btn-icon-sm.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Pulsing Dot Animation */
@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulsing-dot {
  animation: pulse-dot 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

.monitor-log-item {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-log-item.new-video {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.monitor-log-time {
  color: #64748b;
  font-size: 0.75rem;
}




/* ==========================================================================
   CHANNEL VIDEOS MODAL & STATUS STYLES (v4.8 - Fixed Flex Scroll & Layout)
   ========================================================================== */

.cv-modal-box {
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 18px;
  width: min(1200px, 96vw);
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  position: relative;
}

.cv-videos-list-container {
  flex: 1 1 auto;
  min-height: 0; /* CRITICAL: Enables proper overflow scrolling in flexbox */
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 16px;
  align-content: start;
}

/* Custom Scrollbar for Modal */
.cv-videos-list-container::-webkit-scrollbar {
  width: 10px;
}
.cv-videos-list-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 6px;
}
.cv-videos-list-container::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 6px;
  border: 2px solid rgba(15, 23, 42, 0.8);
}
.cv-videos-list-container::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

.cv-video-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 135px;
  height: auto;
  flex-shrink: 0; /* Prevents cards from squishing! */
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cv-video-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.2);
}

.cv-video-card.is-new {
  border-color: rgba(249, 115, 22, 0.6);
  background: rgba(249, 115, 22, 0.05);
}

.cv-video-card.is-downloaded {
  border-color: rgba(16, 185, 129, 0.35);
  opacity: 0.95;
}

.cv-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  width: 58px;
}

.cv-item-chk {
  accent-color: #6366f1;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.cv-thumb-wrapper {
  position: relative;
  width: 85px;
  height: 118px;
  min-width: 85px;
  min-height: 118px;
  flex-shrink: 0; /* Vertical Poster 3:4 ratio */
  border-radius: 8px;
  overflow: hidden;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.cv-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cv-badge-new {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
  animation: pulse-dot 1.5s infinite;
  text-align: center;
  white-space: nowrap;
}

.cv-badge-downloaded {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
}

.cv-badge-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #f1f5f9;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  z-index: 2;
}

.cv-video-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.cv-video-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.cv-video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #94a3b8;
  padding: 1px 0;
}

.cv-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.chk-status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.15s ease;
}

.chk-status-label:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.chk-status-label input {
  accent-color: #10b981;
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.btn-cv-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-cv-action.btn-dl-video {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-cv-action.btn-dl-video:hover {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.btn-cv-action.btn-dl-mp3 {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.1);
  border-color: rgba(192, 132, 252, 0.3);
}

.btn-cv-action.btn-dl-mp3:hover {
  background: #c084fc;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.45);
}

.btn-cv-action.btn-link-orig {
  color: #94a3b8;
}

.btn-cv-action.btn-link-orig:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.btn-card-view-videos {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-card-view-videos:hover {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}


/* Channel Card Folder Row Styles */
.monitor-folder-row {
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 5px 8px !important;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.monitor-folder-row:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
}

.btn-change-channel-folder {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-change-channel-folder:hover {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}


/* ==========================================================================
   TASK CARDS IN TIẾN TRÌNH & LỊCH SỬ TAB
   ========================================================================== */
.task-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 16px !important;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  overflow: hidden;
  min-height: 80px;
  box-sizing: border-box;
}

.task-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.task-thumb-col {
  position: relative;
  width: 95px !important;
  height: 60px !important;
  min-width: 95px !important;
  min-height: 60px !important;
  max-width: 95px !important;
  max-height: 60px !important;
  border-radius: 8px;
  overflow: hidden;
  background: #090d16;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.task-thumb-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.task-mini-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
  z-index: 2;
}

.task-content-col {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.task-status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-status-pill.status-pending {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.task-status-pill.status-downloading {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.task-status-pill.status-processing {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.task-status-pill.status-completed {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.task-status-pill.status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.task-progress-bar-wrapper {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.task-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.task-card.completed .task-progress-bar {
  background: #10b981;
}

.task-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-meta-info {
  font-size: 0.78rem;
  color: #64748b;
}

.task-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}


/* ==========================================================================
   PREVIEW CARD FIXED LAYOUT (DOUYIN 9:16 & BILIBILI 16:9)
   ========================================================================== */
.preview-container {
  margin-top: 24px;
  width: 100%;
}

.preview-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  display: grid !important;
  grid-template-columns: 340px 1fr !important;
  gap: 24px !important;
  align-items: start !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden !important;
  box-sizing: border-box;
}

.preview-cover-col {
  position: relative !important;
  width: 100% !important;
  max-width: 340px !important;
  min-height: 190px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #090d16 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.cover-img {
  width: 100% !important;
  height: 100% !important;
  max-height: 380px !important;
  object-fit: cover !important;
  display: block !important;
}

.avatar-sm {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0 !important;
  display: block !important;
}

.preview-info-col {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.author-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.author-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.author-sub {
  font-size: 0.82rem;
  color: #94a3b8;
}

.video-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.5;
  color: #ffffff;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.format-selection-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.format-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.format-option-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.format-option-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
}

.format-option-card.selected {
  background: rgba(99, 102, 241, 0.18);
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.format-card-icon {
  font-size: 18px;
  color: #818cf8;
}

.format-card-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.format-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.format-quality {
  font-size: 0.72rem;
  color: #94a3b8;
}

.preview-actions-row {
  margin-top: 8px;
}

/* ========================================================
   HONGGUO SHORT DRAMA (HỒNG QUẢ 短剧) STYLES
   ======================================================== */
.hg-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hg-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 20px;
  position: sticky;
  top: 10px;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-lg);
  transition: all 0.25s ease;
}

.hg-search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 14px;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
  transition: border-color 0.2s;
}

.hg-search-wrapper:focus-within {
  border-color: #f43f5e;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.25);
}

.hg-search-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
}

.hg-search-input::placeholder {
  color: var(--text-muted);
}

.hg-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hg-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hg-tab-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}

.hg-tab-btn.active {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  border-color: #f43f5e;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
}

/* Sub Filters Toolbar (Bộ lọc con cho mọi tab chính) */
.hg-sub-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: rgba(10, 16, 28, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  width: 100%;
}

.hg-sub-filter-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hg-sub-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hg-filter-group-title {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 600;
  margin-right: 2px;
}

.hg-sub-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.hg-sub-filter-btn:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.hg-sub-filter-btn.active {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-color: #f43f5e;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.35);
}

.hg-sub-filter-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

.hg-sub-filter-reset {
  background: none;
  border: 1px dashed rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s;
  display: none;
  align-items: center;
  gap: 4px;
}

.hg-sub-filter-reset:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fff;
}

.hg-drama-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
  padding-bottom: 30px;
}

.hg-drama-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  height: 100%;
  min-height: 270px;
}

.hg-drama-card:hover {
  transform: translateY(-6px);
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 16px 36px rgba(244, 63, 94, 0.2), 0 0 20px rgba(244, 63, 94, 0.15);
}

.hg-card-poster-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  min-height: 200px;
  flex-shrink: 0;
  overflow: hidden;
  background: #0f172a;
}

.hg-card-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hg-drama-card:hover .hg-card-poster {
  transform: scale(1.06);
}

/* Card Top Bars */
.hg-card-top-right-bar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.hg-card-top-left-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  z-index: 5;
}

.hg-card-badge-ep {
  position: relative;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hg-card-badge-tag {
  position: relative;
  background: linear-gradient(135deg, #f43f5e, #be123c);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.hg-card-info {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 auto;
  min-height: 75px;
}

.hg-card-title-vi {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hg-card-title-zh {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hg-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hg-tag-pill {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Modal Detail & Episode Picker - 2-Column Split Layout */
.hg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hg-modal-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  width: 96vw;
  max-width: 1300px;
  height: 90vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85);
  position: relative;
}

/* Nút đóng nổi góc trên bên phải */
.hg-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
}

.hg-modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  color: #fff;
  transform: rotate(90deg) scale(1.1);
}

/* 2-Column Grid Body */
.hg-modal-body-2col {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100%;
  overflow: hidden;
}

/* ===== CỘT TRÁI (LEFT COLUMN): THÔNG TIN PHIM ===== */
.hg-modal-col-left {
  background: rgba(10, 15, 30, 0.8);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hg-left-scroll-inner {
  padding: 24px 20px;
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hg-left-scroll-inner::-webkit-scrollbar {
  width: 5px;
}
.hg-left-scroll-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.hg-left-scroll-inner::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hg-poster-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hg-modal-poster {
  width: 170px;
  aspect-ratio: 3/4;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  transition: transform 0.3s ease;
}

.hg-modal-poster:hover {
  transform: scale(1.02);
}

.hg-left-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hg-modal-title-vi {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  margin: 0;
}

.hg-modal-title-zh {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 500;
}

.hg-badges-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}

.hg-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  line-height: 1.3;
}

.hg-badge-gold {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.hg-badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.hg-badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.hg-badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.hg-platform-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.hg-platform-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.hg-platform-btn.active {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(251, 191, 36, 0.25));
  color: #fff;
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.2);
  font-weight: 700;
}

.hg-modal-date-badge {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.hg-tags-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.hg-tag-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.hg-intro-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
}

.hg-intro-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hg-modal-intro {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0;
  word-break: break-word;
}

/* ===== CỘT PHẢI (RIGHT COLUMN): DEMO VIDEO & CHỌN TẬP & NÚT TẢI ===== */
.hg-modal-col-right {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.45);
  padding-right: 48px; /* Chừa khoảng trống cho nút đóng nổi */
}

/* Controls Bar */
.hg-modal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Episodes Grid */
.hg-episodes-container {
  padding: 12px 18px;
  overflow-y: auto;
  flex: 1;
  min-height: 140px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
  align-content: start;
}

.hg-episodes-container::-webkit-scrollbar {
  width: 5px;
}
.hg-episodes-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.hg-episodes-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hg-ep-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 2px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  position: relative;
  user-select: none;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.hg-ep-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
  color: #fff;
}

.hg-ep-btn.selected {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-color: #f43f5e;
  color: #fff;
  box-shadow: 0 3px 10px rgba(244, 63, 94, 0.35);
}

.hg-ep-free-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
}

.hg-ep-btn.is-locked {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
  color: #64748b;
  opacity: 0.78;
}

.hg-ep-btn.is-locked:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
  color: #94a3b8;
}

.hg-ep-btn.is-locked.selected {
  background: linear-gradient(135deg, #475569, #334155);
  border-color: #64748b;
  color: #cbd5e1;
  box-shadow: none;
}

.hg-ep-lock-icon {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 7px;
  color: #94a3b8;
  opacity: 0.6;
}

/* Modal Footer */
.hg-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

/* Responsive fallback for smaller screens */
@media (max-width: 960px) {
  .hg-modal-card {
    height: 95vh;
    max-height: 95vh;
  }
  .hg-modal-body-2col {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .hg-modal-col-left {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: auto;
    max-height: none;
  }
  .hg-modal-col-right {
    padding-right: 0;
    height: auto;
  }
}


/* Aspect Ratio Badges on Drama Card */
.hg-card-badge-ratio {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hg-card-badge-ratio.ratio-vertical {
  background: rgba(147, 51, 234, 0.85);
  color: #f3e8ff;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

.hg-card-badge-ratio.ratio-horizontal {
  background: rgba(14, 165, 233, 0.85);
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Demo Video Player in Modal */
.hg-demo-player-section {
  padding: 12px 20px 8px 20px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.hg-demo-header-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 700;
}

.hg-demo-timer-pill {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #7dd3fc;
}

.hg-demo-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.hg-demo-close-btn:hover {
  color: #f43f5e;
}

.hg-demo-video-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 4px;
}

.hg-demo-video {
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  background: #000;
  max-height: 330px;
  object-fit: contain;
}

.hg-demo-video.ratio-vertical {
  aspect-ratio: 9/16;
  max-width: 195px;
  border: 1.5px solid rgba(192, 132, 252, 0.4);
}

.hg-demo-video.ratio-horizontal {
  aspect-ratio: 16/9;
  width: 100%;
  max-width: 580px;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
}


.hg-demo-overlay-limit {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  text-align: center;
  padding: 16px;
  z-index: 10;
}

.hg-demo-overlay-locked {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  text-align: center;
  padding: 24px 20px;
  z-index: 12;
}

.hg-demo-lock-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.15);
  border: 1.5px solid rgba(244, 63, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hg-ep-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  font-size: 0.52rem;
  margin-left: 2px;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.hg-ep-play-btn:hover {
  background: #38bdf8;
  color: #0f172a;
  transform: scale(1.15);
}

.hg-ep-shield-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  font-size: 0.52rem;
  margin-left: 2px;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.hg-ep-shield-btn:hover {
  background: #6366f1;
  color: #ffffff;
  transform: scale(1.18);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

/* Hongguo Publish Date styling */
.hg-card-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.hg-card-badge-date {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid rgba(147, 197, 253, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.hg-card-badge-date.badge-today {
  background: rgba(24, 24, 27, 0.88);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.6);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.hg-card-badge-date.badge-yesterday {
  background: rgba(12, 74, 110, 0.85);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
  font-weight: 700;
}

.hg-card-badge-date.badge-upcoming {
  background: rgba(136, 19, 55, 0.85);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.6);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.4);
  animation: pulseNewBadge 2.5s infinite ease-in-out;
}

.hg-upcoming-card-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.hg-upcoming-btn-auto {
  flex: 1;
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.hg-upcoming-btn-auto.active {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  border-color: #f43f5e;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.4);
}

.hg-upcoming-btn-remove {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hg-upcoming-btn-remove:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fee2e2;
}

.hg-card-date {
  font-size: 0.72rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.hg-modal-date-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}


.cv-video-title-orig {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

/* ========================================================================= */
/* HONGGUO WATCHLIST & MERGE EPISODES STYLES                                */
/* ========================================================================= */
.hg-card-badge-new {
  position: relative;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.75);
  animation: pulseNewBadge 2s infinite ease-in-out;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

@keyframes pulseNewBadge {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(244, 63, 94, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 0 16px rgba(244, 63, 94, 0.95); }
}

.hg-card-bookmark-btn {
  position: relative;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hg-card-bookmark-btn:hover {
  transform: scale(1.15);
  background: rgba(244, 63, 94, 0.3);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.5);
}

.hg-card-bookmark-btn.active {
  background: rgba(244, 63, 94, 0.9);
  color: #ffffff;
  border-color: #f43f5e;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.5);
}

.hg-merge-check-label {
  transition: all 0.2s ease;
}

.hg-merge-check-label:hover {
  background: rgba(14, 165, 233, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* ========================================================================= */
/* HONGGUO DOWNLOAD TRACKING & EPISODE PROGRESS STYLES                      */
/* ========================================================================= */
.hg-modal-dl-stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
}

.hg-dl-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hg-dl-stat-label {
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hg-dl-stat-val {
  color: #f8fafc;
  font-weight: 700;
}

.text-emerald {
  color: #10b981 !important;
}

.text-sky {
  color: #38bdf8 !important;
}

.text-rose {
  color: #f43f5e !important;
}

/* Card Download Status Badge */
.hg-card-dl-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hg-card-dl-status.dl-full {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.hg-card-dl-status.dl-partial {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.hg-card-dl-status.dl-none {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.hg-card-dl-status.dl-has-new {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(251, 113, 133, 0.15));
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.5);
  animation: pulseNewBadge 2s infinite ease-in-out;
}

/* Episode button states */
.hg-ep-btn.is-downloaded {
  border-color: rgba(16, 185, 129, 0.5) !important;
  background: rgba(16, 185, 129, 0.1) !important;
  color: #a7f3d0 !important;
}

.hg-ep-btn.is-downloaded .hg-ep-dl-check {
  color: #10b981;
  font-size: 0.7rem;
  margin-left: 2px;
}

.hg-ep-btn.is-new-ep {
  border-color: rgba(244, 63, 94, 0.6) !important;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.3);
  position: relative;
}

.hg-ep-btn.is-new-ep .hg-ep-new-tag {
  position: absolute;
  top: -6px;
  right: -4px;
  background: #f43f5e;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
}

.hg-ep-btn.hg-ep-active-loading {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
  animation: hgPulseLoading 1.2s infinite;
}
@keyframes hgPulseLoading {
  0%, 100% { background: rgba(56, 189, 248, 0.15); }
  50% { background: rgba(56, 189, 248, 0.35); }
}

.hg-ep-btn.hg-ep-active-playing {
  border-color: #06b6d4 !important;
  background: rgba(6, 182, 212, 0.22) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.45) !important;
}

/* ========================================================================= */
/* COPYRIGHT STATUS BADGES & SHIELDS                                         */
/* ========================================================================= */
.hg-card-badge-copyright {
  position: relative;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
}

.hg-card-badge-copyright.clean {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.6);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45);
}

.hg-card-badge-copyright.claimed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
  color: #ffffff;
  border: 1px solid rgba(248, 113, 113, 0.6);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.45);
}


.hg-ep-shield-btn.clean {
  background: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5) !important;
}

.hg-ep-shield-btn.claimed {
  background: rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5) !important;
}

.hg-badge-copyright-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hg-badge-copyright-modal.clean {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.hg-badge-copyright-modal.clean:hover {
  background: rgba(16, 185, 129, 0.28);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.hg-badge-copyright-modal.claimed {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.hg-badge-copyright-modal.claimed:hover {
  background: rgba(239, 68, 68, 0.28);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.hg-badge-copyright-modal.unmarked {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.hg-badge-copyright-modal.unmarked:hover {
  background: rgba(148, 163, 184, 0.22);
}

/* ========================================================================= */
/* HONGGUO MULTI-SEASON (CÁC MÙA / PHẦN CÙNG BỘ) STYLES                     */
/* ========================================================================= */
.hg-seasons-container {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.hg-seasons-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hg-seasons-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fda4af;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hg-seasons-tip {
  font-size: 0.72rem;
  color: #94a3b8;
  font-style: italic;
}

.hg-seasons-chips-list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.hg-seasons-chips-list::-webkit-scrollbar {
  height: 4px;
}

.hg-seasons-chips-list::-webkit-scrollbar-thumb {
  background: rgba(244, 63, 94, 0.4);
  border-radius: 4px;
}

.hg-season-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.hg-season-chip:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

.hg-season-chip.active {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-color: #fb7185;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6);
  cursor: default;
  pointer-events: none;
}

.hg-season-chip-badge {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: 10px;
  opacity: 0.9;
}




/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (UI/UX OPTIMIZED FOR PHONES)
   ========================================================================== */

@media (max-width: 768px) {
  /* Safe area and compact root padding */
  body {
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  .app-container {
    padding: 10px 10px calc(16px + env(safe-area-inset-bottom, 0px)) 10px;
    gap: 14px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 1. Sleek Navbar & Mobile Tab Bar */
  .navbar {
    padding: 12px 14px;
    gap: 12px;
    border-radius: 16px;
    flex-direction: column;
    align-items: stretch;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .brand {
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .brand-text h1 {
    font-size: 16px;
    margin: 0;
  }

  .brand-text p {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    margin: 0;
  }

  .tab-label-full { display: none !important; }
  .tab-label-short { display: inline !important; }

  /* Fixed Bottom Navigation Bar on Mobile - ZERO HORIZONTAL SCROLL */
  .nav-tabs {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 58px !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 !important;
    padding: 3px 4px calc(3px + env(safe-area-inset-bottom, 0px)) 4px !important;
    margin: 0 !important;
    z-index: 9990 !important;
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 2px !important;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.65) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .nav-tab {
    flex: 1 1 0 !important;
    padding: 3px 1px !important;
    font-size: 9.5px !important;
    font-weight: 600 !important;
    gap: 2px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    min-width: 0 !important;
    position: relative !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .nav-tab i {
    font-size: 1.15rem !important;
    margin: 0 !important;
    line-height: 1 !important;
  }

  .nav-tab span {
    font-size: 9px !important;
    letter-spacing: -0.2px !important;
    line-height: 1 !important;
  }

  .nav-tab.active {
    color: #f43f5e !important;
    background: rgba(244, 63, 94, 0.12) !important;
    box-shadow: none !important;
  }

  .nav-tab.active i {
    color: #f43f5e !important;
    transform: scale(1.1);
  }

  .task-count-badge {
    position: absolute !important;
    top: 2px !important;
    right: 10% !important;
    padding: 1px 4px !important;
    font-size: 8px !important;
    border-radius: 8px !important;
    line-height: 1 !important;
  }

  body {
    padding-bottom: calc(65px + env(safe-area-inset-bottom, 16px)) !important;
  }

  /* 2. Hero Section */
  .hero-banner {
    margin: 6px 0 16px 0;
    text-align: center;
  }

  .hero-banner h2 {
    font-size: 20px;
    line-height: 1.35;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
  }

  .hero-banner p {
    font-size: 12px;
    line-height: 1.4;
    padding: 0 8px;
  }

  /* 3. Input Card & URL Input Wrapper */
  .input-card {
    padding: 14px 12px;
    gap: 12px;
    border-radius: 16px;
  }

  .url-input-wrapper {
    padding: 6px 8px 6px 12px;
    gap: 8px;
    min-height: 48px;
  }

  .url-input-wrapper .input-icon {
    font-size: 14px;
  }

  .url-input-wrapper input {
    font-size: 13.5px;
    min-width: 0;
  }

  .url-input-wrapper input::placeholder {
    font-size: 12px;
  }

  .btn-clear-input {
    width: 28px;
    height: 28px;
    font-size: 13px;
    flex-shrink: 0;
  }

  #btnPasteUrl {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 11.5px;
    border-radius: 8px;
    height: 34px;
    white-space: nowrap;
  }

  #btnPasteUrl span {
    display: inline;
  }

  /* Input Card Footer & Tips */
  .input-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .input-card-tips {
    justify-content: center;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.35;
    gap: 6px;
  }

  .btn-analyze {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--primary-glow);
  }

  /* 4. Platform Showcase Grid */
  .platform-showcase-container {
    margin-top: 14px;
    padding: 12px 10px;
  }

  .platform-showcase-grid {
    gap: 6px 8px;
  }

  .platform-item {
    padding: 4px 8px 4px 6px;
    font-size: 11px;
    gap: 5px;
  }

  .platform-icon-wrapper {
    width: 20px;
    height: 20px;
  }

  .platform-name {
    font-size: 10.5px;
  }

  /* 5. Single Video Result Card (Preview) */
  .preview-card {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .media-thumb-box {
    max-height: 280px;
    aspect-ratio: 16/9;
  }

  .preview-info-col {
    gap: 12px;
  }

  .media-title {
    font-size: 15px;
    line-height: 1.4;
  }

  .media-meta-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .preview-actions-row,
  .preview-action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .preview-actions-row .btn,
  .preview-action-row .btn {
    width: 100%;
    justify-content: center;
  }

  /* 6. Batch Download Pane */
  .batch-input-area {
    padding: 14px;
    border-radius: 16px;
  }

  .batch-options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* 7. Task Card & History */
  .task-card {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .task-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .task-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .task-info {
    min-width: 0;
    flex: 1;
  }

  .task-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .task-meta {
    font-size: 11px;
    flex-wrap: wrap;
  }

  .task-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
  }

  .task-actions .btn {
    flex: 1;
    padding: 7px 10px;
    font-size: 11.5px;
    justify-content: center;
  }

  /* 8. Hongguo Drama Cards (Phim Trung) - 2 Columns on Mobile with Full Title & Meta */
  .hg-drama-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding-bottom: 24px !important;
  }

  .hg-drama-card {
    border-radius: 12px !important;
    height: auto !important;
    min-height: 290px !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
  }

  .hg-card-poster-wrapper {
    width: 100% !important;
    aspect-ratio: 3/4 !important;
    min-height: 200px !important;
    max-height: none !important;
    flex-shrink: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .hg-card-poster {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  .hg-card-info {
    display: block !important;
    padding: 8px 10px 10px 10px !important;
    background: rgba(15, 23, 42, 0.98) !important;
  }

  .hg-card-title-vi {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #ffffff !important;
    margin: 0 0 5px 0 !important;
    min-height: 20px !important;
    max-height: none !important;
  }

  /* Ẩn tên tiếng Trung trên điện thoại để dành toàn bộ không gian cho Tiêu đề Tiếng Việt và Ngày đăng */
  .hg-card-title-zh {
    display: none !important;
  }

  .hg-card-tags {
    display: none !important;
  }

  .hg-card-footer-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    margin-top: 2px !important;
    padding-top: 0 !important;
    font-size: 0.72rem !important;
  }

  .hg-card-release-bar {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    white-space: nowrap !important;
  }

  /* 8.5. Compact Filter Bar on Mobile */
  .hg-filter-bar {
    padding: 8px 10px !important;
    gap: 8px !important;
    border-radius: 14px !important;
    position: relative !important;
    top: 0 !important;
  }

  .hg-search-wrapper {
    min-width: 100% !important;
    max-width: 100% !important;
    padding: 4px 10px !important;
    height: 38px !important;
  }

  .hg-search-input {
    font-size: 0.82rem !important;
  }

  .btn-hg-search {
    padding: 4px 10px !important;
    font-size: 0.78rem !important;
  }

  /* Single-row swipeable category chips */
  .hg-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 2px 0 4px 0 !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .hg-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .hg-tab-btn {
    flex-shrink: 0 !important;
    padding: 5px 12px !important;
    font-size: 0.78rem !important;
    border-radius: 16px !important;
    white-space: nowrap !important;
  }

  /* Actions Bar with Sub-filter Toggle */
  .hg-filter-actions-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 6px !important;
    margin-top: 2px !important;
  }

  .hg-btn-toggle-subfilters {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: rgba(244, 63, 94, 0.12) !important;
    border: 1px solid rgba(244, 63, 94, 0.35) !important;
    color: #fda4af !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
  }

  .hide-mobile-text {
    display: none !important;
  }

  /* Collapsible Sub-filters on Mobile */
  .hg-sub-filters {
    display: none !important;
    padding: 10px !important;
    border-radius: 10px !important;
    background: rgba(10, 16, 28, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 100% !important;
    flex-direction: column !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }
  .hg-sub-filters.mobile-expanded {
    display: flex !important;
  }

  .hg-sub-filter-group {
    flex-wrap: wrap !important;
    gap: 5px !important;
  }
  .hg-sub-filter-btn {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
  }

  /* 9. Modals (Detail Dialogs) on Mobile - Full View & Smooth Episode Scrolling */
  .hg-modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  #hgDetailModalOverlay {
    padding: 0 !important;
    inset: 0 !important;
    position: fixed !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #0b1120 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  .modal-content,
  .hg-modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0f172a !important;
    position: fixed !important;
    inset: 0 !important;
  }

  .hg-modal-close-btn {
    top: 10px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    z-index: 100 !important;
  }

  /* Single Unified Scroll Container */
  .hg-modal-body-2col {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 12px calc(80px + env(safe-area-inset-bottom, 10px)) 12px !important;
    gap: 12px !important;
    height: auto !important;
    max-height: none !important;
  }

  .hg-modal-col-left {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .hg-left-scroll-inner {
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .hg-poster-wrapper {
    width: 90px !important;
    flex-shrink: 0 !important;
  }

  .hg-modal-poster {
    width: 90px !important;
    height: 120px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  }

  .hg-left-meta {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .hg-modal-title-vi {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    color: #f8fafc !important;
    margin: 0 0 3px 0 !important;
  }

  .hg-modal-title-zh {
    font-size: 0.72rem !important;
    color: #64748b !important;
    margin-bottom: 5px !important;
  }

  .hg-badges-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px 5px !important;
    align-items: center !important;
    margin-bottom: 4px !important;
  }

  .hg-badge-pill {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    border-radius: 5px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  #hgBtnToggleWatchlist {
    padding: 2px 7px !important;
    font-size: 0.68rem !important;
    height: 20px !important;
    border-radius: 5px !important;
  }

  .hg-intro-box {
    display: none !important; /* Hide long synopsis on mobile to prioritize episodes & demo */
  }

  .hg-modal-col-right {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* Multi-season bar on mobile */
  .hg-seasons-chips-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
    padding: 4px 2px !important;
  }

  /* Stats Bar on Mobile */
  .hg-modal-dl-stats-bar {
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
    gap: 6px !important;
    border-radius: 8px !important;
  }

  /* Controls Bar on Mobile */
  .hg-modal-controls {
    padding: 8px 10px !important;
    border-radius: 10px !important;
    gap: 8px !important;
  }

  .hg-modal-controls > div {
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Episode Grid on Mobile: all episodes visible and scrollable */
  .hg-episodes-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)) !important;
    gap: 6px !important;
    padding: 6px 0 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  .hg-ep-btn {
    height: 42px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
  }

  /* Sticky Footer Download Bar on Mobile */
  .hg-modal-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 6px)) 12px !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  #hgBtnDownloadSelected {
    flex: 1 !important;
    font-size: 0.85rem !important;
    padding: 10px 14px !important;
  }

  #hgBtnScanCopyrightEp1,
  #hgBtnScanCopyrightFull,
  #hgBtnMarkCopyrightClean {
    display: none !important;
  }

  #hgBtnCloseModalFooter {
    display: inline-flex !important;
    padding: 9px 14px !important;
  }

  /* Demo Player Responsive Fix on Mobile */
  .hg-demo-player-section {
    border-radius: 12px !important;
    overflow: hidden !important;
    margin: 10px 0 !important;
    background: #0b1120 !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    position: relative !important;
    z-index: 5 !important;
  }

  .hg-demo-video {
    max-height: 240px !important;
    width: 100% !important;
    background: #000 !important;
  }

  /* Floating Background Copyright Scan Widget on Mobile */
  .floating-cp-scan-bar {
    bottom: calc(75px + env(safe-area-inset-bottom, 10px)) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
  }

  /* 10. Settings Pane */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-group {
    padding: 14px;
    border-radius: 14px;
  }
}

/* Extra small devices (<= 400px - iPhone 12/13/14 mini, SE) */
@media (max-width: 400px) {
  .app-container {
    padding: 8px 6px calc(14px + env(safe-area-inset-bottom, 0px)) 6px;
  }

  .brand-text p {
    display: none; /* Hide subtitle to keep header compact */
  }

  .hero-banner h2 {
    font-size: 18px;
  }

  #btnPasteUrl span {
    display: none; /* Icon only on extra small screens */
  }

  #btnPasteUrl {
    padding: 6px 9px;
  }
}

/* Floating Download Banner (1-Chạm Bắn Về Máy) */
.floating-dl-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.2);
  animation: slideUpBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
}

@keyframes slideUpBanner {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dl-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dl-banner-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dl-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.dl-banner-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.dl-banner-close:hover {
  color: #ef4444;
}

/* Floating Background Copyright Scan Widget (PC & Mobile) */
.floating-cp-scan-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.35);
  z-index: 999999;
  animation: slideUpBanner 0.25s ease;
}

.floating-cp-scan-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.floating-cp-scan-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.floating-cp-scan-info {
  flex: 1;
  min-width: 0;
}

.floating-cp-scan-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.floating-cp-scan-title span:first-child {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-cp-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.floating-cp-scan-bar-bg {
  background: #1e293b;
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.floating-cp-scan-bar-fill {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.floating-cp-scan-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-cp-close-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}

.floating-cp-close-btn:hover {
  color: #f43f5e;
}

