/* ═══════════════════════════════════════════
   获客鸭 — Clean Light Theme
   Mobile-First · Responsive
   Inspired by DAAI design language
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

/* ─── Variables ─── */
:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-muted: rgba(255,255,255,0.88);
  --text: #18181b;
  --text2: #71717a;
  --text3: #a1a1aa;
  --border: rgba(0,0,0,0.06);
  --border-strong: rgba(0,0,0,0.1);
  --accent: #18181b;
  --accent-light: rgba(24,24,27,0.06);
  --accent-mid: rgba(24,24,27,0.1);
  --green: #10b981;
  --green-light: rgba(16,185,129,0.1);
  --blue: #3b82f6;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.08);
  --gap: 12px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ─── Subtle ambient glow ─── */
body::before {
  content: '';
  position: fixed;
  top: -40vh;
  right: -20vw;
  width: 70vw;
  height: 70vh;
  background: radial-gradient(ellipse, rgba(24,24,27,0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app { position: relative; z-index: 1; width: min(96vw, 1500px); max-width: 1500px; margin: 0 auto; padding: 0 18px 80px; }

/* ─── Header ─── */
.header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
  gap: 12px;
  margin-bottom: 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 183, 195, 0.18);
}
.logo-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.header hgroup { line-height: 1.3; }
.header h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.header-sub { font-size: 0.72rem; color: var(--text2); margin-top: 1px; }

/* ─── Tabs ─── */
.tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  overflow: visible !important;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 7px 13px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

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

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  margin-right: 5px;
  color: currentColor;
  font-size: 1em;
  font-weight: 700;
  line-height: 1;
}

.tab.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.nav-group { position: relative; z-index: 1; flex: 0 0 auto; }
.nav-group[open] { z-index: 101; }
.nav-group summary { list-style: none; display: flex; align-items: center; gap: 5px; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-caret { color: currentColor; font-size: .75rem; line-height: 1; transition: transform .18s ease; }
.nav-group[open] .nav-caret { transform: rotate(180deg); }
.nav-menu { position: absolute; z-index: 100; top: 100%; left: 0; display: grid; min-width: 132px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 14px 30px rgba(35,43,67,.16); }
.nav-group:not([open]):hover > .nav-menu { display: grid; }
.nav-menu-item { display:flex; align-items:center; padding: 8px 10px; border-radius: 7px; color: var(--text2); font-size: .78rem; text-decoration: none; white-space: nowrap; transition: background .16s ease, color .16s ease; }
.nav-menu-item .nav-icon { width:1.1em; margin-right:7px; font-size:.92em; opacity:.78; }
.nav-menu-item:hover, .nav-menu-item.active { color: var(--accent); background: var(--accent-light); }

/* ─── Tab Panels ─── */
.tab-panel { display: none; flex-direction: column; gap: var(--gap); }
.tab-panel.active { display: flex; }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}

.card:focus-within { border-color: var(--border-strong); }

.card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 16px;
}

.card-step {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text2);
  background: var(--accent-light);
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* ─── Input ─── */
.input-group { display: flex; flex-direction: column; gap: 8px; }

.input-wrapper {
  display: flex;
  gap: 8px;
}

.input-wrapper input[type="text"],
.input-wrapper input:not([type="file"]) {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.input-wrapper input::placeholder { color: var(--text3); }

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ─── Buttons ─── */
.btn-primary {
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-primary:hover {
  background: #27272a;
  box-shadow: 0 4px 14px rgba(24,24,27,0.2);
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger { background: var(--danger); color: #fff; border: none; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.82rem; font-weight: 600; transition: all .2s; font-family: inherit; }
.btn-danger:hover { opacity: .85; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-outline:hover { border-color: var(--border-strong); color: var(--text); background: var(--accent-light); }

.btn-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) { border-color: var(--border-strong); color: var(--accent); background: var(--accent-light); }
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-text {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  font-family: inherit;
}

.btn-text:hover { color: var(--accent); }

/* ─── Status ─── */
.status {
  font-size: 0.82rem;
  color: var(--text2);
  min-height: 1.4em;
  margin-top: 8px;
  word-break: break-all;
}

/* ─── Result ─── */
.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text3);
}

.result-placeholder p { font-size: 0.9rem; }

.result-content { animation: fadeIn 0.3s ease; }

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.result-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.result-tags span {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--text2);
  font-weight: 500;
}

.result-stats {
  font-size: 0.78rem;
  color: var(--text2);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.result-stats span { display: inline-flex; align-items: center; gap: 3px; }

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.result-head h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  flex: 1;
}

.result-actions { display: flex; gap: 6px; flex-shrink: 0; }

.result-time {
  font-size: 0.75rem;
  color: var(--text3);
  margin-bottom: 12px;
}

.result-text {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

/* ─── History ─── */
.history-list { display: flex; flex-direction: column; gap: 4px; }

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.history-item:hover { background: var(--accent-light); border-color: var(--border); }

.history-item .h-title {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .h-time {
  font-size: 0.72rem;
  color: var(--text3);
  white-space: nowrap;
}

/* ─── Batch ─── */
.batch-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.step { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text2); }

.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-arrow { color: var(--text3); display: flex; }

.batch-progress { margin-top: 12px; }

.progress-track {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.batch-message { font-size: 0.82rem; color: var(--text2); margin-top: 8px; }

.batch-log {
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 12px;
  max-height: 40vh;
  overflow-y: auto;
}

.feishu-link { margin-top: 8px; }
.feishu-link a { color: var(--blue); font-size: 0.85rem; text-decoration: none; font-weight: 500; }
.feishu-link a:hover { text-decoration: underline; }

/* ─── Monitor ─── */
.monitor-desc { font-size: 0.82rem; color: var(--text2); line-height: 1.6; }
.monitor-desc strong { color: var(--accent); }

.monitor-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }

.monitor-blogger-card { width: 100%; }

.monitor-bottom-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
}

.blogger-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.blogger-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.blogger-list .empty { grid-column: 1 / -1; }

.blogger-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}

.blogger-item:hover { background: var(--accent-light); }

.blogger-item.selected {
  background: var(--accent-light);
  border-color: var(--border-strong);
}

.blogger-item .blogger-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.blogger-item.selected .blogger-check {
  border-color: var(--accent);
  background: var(--accent);
}

.blogger-item.selected .blogger-check::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.blogger-item .blogger-info { flex: 1; min-width: 0; }
.blogger-item .blogger-name { font-size: 0.82rem; font-weight: 700; display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blogger-item .blogger-url { font-size: 0.7rem; color: var(--text3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.blogger-remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.blogger-remove:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

.empty { font-size: 0.82rem; color: var(--text3); padding: 20px 0; text-align: center; }

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text2);
  background: var(--accent-light);
  padding: 1px 10px;
  border-radius: 20px;
  margin-left: auto;
}

/* ─── Monitor Status Card ─── */
.monitor-status-card,
.monitor-log-card { min-width: 0; }

.monitor-info { display: flex; flex-direction: column; gap: 2px; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }

.info-label {
  color: var(--text2);
  font-weight: 500;
  font-size: 0.82rem;
}
.info-value {
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Status dot indicator */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.idle { background: var(--text3); }
.status-dot.running { background: var(--green); animation: pulse 1.2s ease-in-out infinite; }
.status-dot.error { background: var(--danger); }

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

.status-idle { color: var(--text3); }
.status-running { color: var(--green); font-weight: 700; }
.status-error { color: var(--danger); font-weight: 600; }

/* ─── Monitor Log ─── */
.monitor-log {
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  height: 260px;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 4px;
}

.monitor-log:empty::before {
  content: "暂无日志";
  color: var(--text3);
  font-style: italic;
}

/* ─── Toggle ─── */
.toggle { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 11px;
  transition: 0.25s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeIn 0.3s ease; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ═══════════════════════════════════════════
   Mobile (≤ 640px)
   ═══════════════════════════════════════════ */


/* ─── Action Buttons Bar ─── */
.result-actions-bar {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

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

.btn-copy {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-copy:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--border-strong);
}

.btn-feishu {
  background: var(--accent);
  border: none;
  color: white;
  box-shadow: 0 2px 8px rgba(24,24,27,0.12);
}

.btn-feishu:hover:not(:disabled) {
  background: #27272a;
  box-shadow: 0 4px 14px rgba(24,24,27,0.2);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .result-actions-bar {
    flex-direction: column;
  }
  .btn-action {
    justify-content: center;
    width: 100%;
  }
}
@media (max-width: 640px) {
  .app { width: 100%; padding: 0 12px 60px; }

  .header {
    display: grid;
    grid-template-areas:
      "brand user"
      "tabs tabs";
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .header-brand { grid-area: brand; justify-content: flex-start; min-width: 0; }
  .user-nav { grid-area: user; justify-self: end; gap: 5px; }
  .user-nav a { padding: 5px 8px; font-size: 0.75rem; }
  .user-menu { gap: 4px; }
  .user-name { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs {
    grid-area: tabs;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow: visible;
    flex-wrap: wrap;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .tab { flex: 0 0 auto; text-align: center; padding: 7px 12px; font-size: 0.78rem; }
  .nav-menu { min-width: 144px; }

  .card { padding: 16px; border-radius: 10px; }

  .input-wrapper { flex-direction: column; }
  .input-wrapper input { width: 100%; }

  .btn-primary, .btn-danger { background: var(--danger); color: #fff; border: none; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.82rem; font-weight: 600; transition: all .2s; font-family: inherit; }
.btn-danger:hover { opacity: .85; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline { justify-content: center; width: 100%; }

  .monitor-grid,
  .monitor-bottom-grid,
  .blogger-list { grid-template-columns: 1fr; }

  .blogger-limit-box {
    align-items: stretch;
    flex-direction: column;
  }
  .blogger-limit-form input { flex: 1; width: 100%; }

  .result-head { flex-direction: column; gap: 8px; }
  .result-actions { align-self: flex-end; }

  .result-text { font-size: 0.85rem; padding: 12px; }

  .batch-steps { flex-direction: column; align-items: flex-start; gap: 4px; }
  .step-arrow { transform: rotate(90deg); padding-left: 10px; }

  .header h1 { font-size: 1.05rem; }
}

@media (max-width: 375px) {
  .logo-icon { width: 38px; height: 38px; border-radius: 10px; }
  .header-sub { display: none; }
  .user-nav a { padding: 5px 7px; }
  .user-name { max-width: 58px; }
}

/* ─── Tablet (641-1024px) ─── */
@media (min-width: 641px) and (max-width: 1024px) {
  .app { width: 96vw; max-width: 1500px; }
  .blogger-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-bottom-grid { grid-template-columns: 1fr; }
}

/* ─── File Input ─── */
input[type="file"] {
  font-size: 0.85rem;
  color: var(--text2);
  padding: 8px 0;
  flex: 1;
}

input[type="file"]::file-selector-button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 10px;
  transition: all 0.2s;
  font-family: inherit;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* ─── Extract Progress ─── */
.extract-progress {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.8;
  max-height: 160px;
  overflow-y: auto;
}

.extract-progress .progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.25s ease;
}

.extract-progress .progress-step::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  flex-shrink: 0;
}

.extract-progress .progress-step:first-child::before {
  opacity: 1;
  background: var(--accent);
}

.extract-progress .progress-step.error {
  color: var(--danger);
  font-weight: 600;
}
.extract-progress .progress-step.error::before {
  background: var(--danger);
  opacity: 1;
}

/* ─── Monitor Progress Bar ─── */
.monitor-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.monitor-progress-step {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.monitor-progress-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 1.2s ease-in-out infinite;
}

.monitor-progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.monitor-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.monitor-progress-ratio {
  font-size: 0.72rem;
  color: var(--text3);
  text-align: right;
}

/* ─── Blogger Item ─── */
.blogger-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.blogger-status {
  font-size: 0.68rem;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text3);
  white-space: nowrap;
}
.blogger-status.active {
  background: rgba(16,185,129,0.12);
  color: var(--green);
  font-weight: 600;
}

.blogger-meta {
  display: flex;
  gap: 12px;
  margin-top: 2px;
}
.blogger-stat {
  font-size: 0.72rem;
  color: var(--text3);
}

.blogger-detail-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text2);
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: inherit;
}
.blogger-detail-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: fadeIn 0.2s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.blogger-limit-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--surface), var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.blogger-limit-box strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2px;
}
.blogger-limit-box p {
  font-size: 0.76rem;
  color: var(--text2);
  line-height: 1.5;
}
.blogger-limit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.blogger-limit-form input {
  width: 86px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
}
.blogger-limit-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.modal-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text2);
}
.modal-stats strong { color: var(--text); }

.modal-runs { display: flex; flex-direction: column; gap: 10px; }
.modal-run-item {
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.modal-run-time {
  font-size: 0.75rem;
  color: var(--text3);
  margin-bottom: 4px;
}
.modal-run-stats {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}
.modal-run-videos {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-video-item {
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.modal-video-item.ok { border-left: 3px solid var(--green); }
.modal-video-item.error { border-left: 3px solid var(--danger); }
.modal-video-item.empty { border-left: 3px solid var(--text3); }

.modal-video-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.modal-video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text3);
  margin-bottom: 2px;
}
.video-stats { color: var(--text2); }
.modal-video-link {
  font-size: 0.72rem;
  margin-top: 4px;
}
.modal-video-link a {
  color: var(--accent);
  text-decoration: none;
}
.modal-video-link a:hover { text-decoration: underline; }
.modal-empty {
  text-align: center;
  color: var(--text3);
  padding: 30px 0;
}

/* ─── Hidden utility ─── */
.hidden { display: none !important; }

/* ─── User Nav ─── */
.user-nav { display: flex; align-items: center; gap: 10px; margin-left: 0; flex-shrink: 0; }
.user-nav a { text-decoration: none; font-size: 13px; padding: 6px 14px; border-radius: 8px; transition: all .2s; }
.btn-login { color: #ff2e4f; border: 1px solid #ff2e4f; }
.btn-login:hover { background: #ff2e4f; color: #fff; }
.btn-register { background: #ff2e4f; color: #fff; }
.btn-register:hover { opacity: 0.85; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-name { color: var(--text); font-weight: 600; text-decoration: none; }
.btn-logout { color: #888; font-size: 12px; }
.btn-logout:hover { color: #ff2e4f; }

@media (max-width: 1080px) {
  .header { flex-wrap: wrap; }
  .tabs { order: 3; flex-basis: 100%; justify-content: flex-start; }
}
