/* PolyPost — Global Styles v2 */

:root {
  --bg: #ffffff;
  --bg-secondary: #f8f7ff;
  --bg-hover: #ede9fe;
  --text: #1e1b4b;
  --text-secondary: #6b6889;
  --border: #e4e0f0;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: rgba(124,58,237,0.08);
  --success: #059669;
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #faf9ff;
  min-width: 1024px;
  height: 100vh;
  overflow: hidden;
}

/* Layout */
.app-container { display: flex; height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, #faf9ff 0%, #f5f3ff 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 400;
}

.sidebar-stats {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.sidebar-stat {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.sidebar-stat .stat-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.sidebar-stat .stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.sidebar-nav { padding: 8px 0; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 1px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  box-shadow: -4px 0 20px rgba(0,0,0,0.03);
}

/* ── Topbar ── */
.topbar {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg);
}

.topbar h2 { font-size: 17px; font-weight: 700; color: var(--text); white-space: nowrap; }

.topbar-stats {
  display: flex;
  gap: 16px;
  flex: 1;
}

.topbar-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-stat strong {
  color: var(--text);
  font-size: 14px;
}

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

/* ── Buttons ── */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  color: var(--text);
}

.btn:hover { background: var(--bg-hover); border-color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(124,58,237,0.3); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-info { background: var(--info); color: #fff; border-color: var(--info); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }

/* ── Form ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg);
  color: var(--text);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Cards ── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #f3f4f6; color: #374151; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.table tr:hover { background: var(--bg-secondary); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30,27,75,0.4); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg);
  border-radius: 12px;
  padding: 24px;
  min-width: 400px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.modal h3 { margin-bottom: 16px; font-size: 16px; font-weight: 700; }

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

/* ── Auth modal ── */
.auth-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30,27,75,0.5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  z-index: 300;
  animation: fadeIn 0.15s ease;
}
.auth-overlay.show { display: flex; }
.auth-box {
  background: var(--bg);
  border-radius: 12px;
  padding: 28px 24px;
  width: 360px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.auth-box h2 { font-size: 18px; font-weight: 800; margin-bottom: 18px; text-align: center; }
.auth-box .form-control { margin-bottom: 12px; }
.auth-box .btn { width: 100%; margin-top: 4px; }
.auth-switch { margin-top: 14px; text-align: center; font-size: 13px; color: var(--text-secondary); }
.auth-switch a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }
.auth-tier-info {
  margin-top: 14px; text-align: center; font-size: 12px;
  color: var(--text-secondary); background: var(--bg-secondary);
  border-radius: var(--radius-sm); padding: 8px;
}

/* ── Sidebar user ── */
.sidebar-user {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.sidebar-user-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sidebar-user-email {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.tier-badge {
  display: inline-block; width: fit-content;
  padding: 1px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}
.tier-free { background: #f3f4f6; color: #374151; }
.tier-pro { background: linear-gradient(135deg, #7c3aed, #6366f1); color: #fff; }
.btn-logout {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-secondary); font-size: 12px; cursor: pointer;
  white-space: nowrap; transition: all var(--transition);
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); background: #fef2f2; }

/* ── Tags ── */
.tags-input {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 36px; align-items: center;
  transition: border-color var(--transition);
}
.tags-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; background: var(--primary-light); border-radius: 12px;
  font-size: 12px; font-weight: 500; color: var(--primary);
}
.tag-chip button { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--primary); padding: 0 2px; opacity: 0.6; }
.tag-chip button:hover { opacity: 1; }

/* ── Editor ── */
.editor-layout { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.editor-left { width: 260px; border-right: 1px solid var(--border); overflow-y: auto; padding: 12px; background: #fdfdff; }
.btn-delete-post { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; line-height: 20px; text-align: center; border: none; background: transparent; color: var(--text-secondary); font-size: 16px; cursor: pointer; border-radius: 4px; opacity: 0; transition: all var(--transition); }
.card:hover .btn-delete-post { opacity: 1; }
.btn-delete-post:hover { background: var(--danger); color: #fff; }
.editor-right { flex: 1; display: flex; flex-direction: column; padding: 16px; overflow: hidden; min-height: 0; }
.editor-right .editor-scrollable { flex:1; overflow-y:auto; min-height:0; padding-right:4px; }

/* scrollbar */
.editor-left::-webkit-scrollbar,
.editor-right .editor-scrollable::-webkit-scrollbar { width: 4px; }
.editor-left::-webkit-scrollbar-thumb,
.editor-right .editor-scrollable::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.editor-preview { flex: 1; display: flex; gap: 0; }
.editor-pane { width: 50%; padding: 12px; overflow-y: auto; }
.editor-pane:first-child { border-right: 1px solid var(--border); }
.editor-preview-content { line-height: 1.8; }
.editor-preview-content h1 { font-size: 1.8em; margin: 0.6em 0; font-weight: 700; }
.editor-preview-content h2 { font-size: 1.4em; margin: 0.5em 0; font-weight: 600; }
.editor-preview-content h3 { font-size: 1.15em; margin: 0.4em 0; font-weight: 600; }
.editor-preview-content p { margin: 0.6em 0; }
.editor-preview-content code { background: var(--bg-secondary); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: var(--primary); }
.editor-preview-content pre { background: #1e1b4b; color: #e2e8f0; padding: 16px; border-radius: var(--radius); overflow-x: auto; }
.editor-preview-content pre code { background: none; color: inherit; padding: 0; }
.editor-preview-content img { max-width: 100%; border-radius: var(--radius-sm); }
.editor-preview-content blockquote {
  border-left: 3px solid var(--primary);
  margin: 0.6em 0;
  padding: 4px 14px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Publish bar ── */
.publish-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; }
.checkbox-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer; padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.checkbox-item:hover { background: var(--bg-hover); }

/* ── Toast ── */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  padding: 12px 20px; border-radius: var(--radius); color: #fff;
  font-size: 13px; font-weight: 500;
  animation: slideInRight 0.3s ease;
  box-shadow: var(--shadow-md);
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Translation ── */
.translate-diff { display: flex; gap: 16px; min-height: 500px; max-height: 70vh; }
.translate-pane { flex: 1; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.translate-pane-header { padding: 10px 14px; background: var(--bg-secondary); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border); }
.translate-pane-body { flex: 1; padding: 16px; overflow-y: auto; }

/* ── Competitor ── */
.competitor-layout { display: flex; flex: 1; min-height: 0; }
.competitor-left { width: 380px; min-width: 380px; border-right: 1px solid var(--border); overflow-y: auto; }
.competitor-right { flex: 1; overflow-y: auto; }
.competitor-card { transition: border-color var(--transition); }
.competitor-card:hover { border-color: var(--primary); }
.competitor-card.selected { border-color: var(--primary); background: var(--bg-secondary); }

/* ── Calendar ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 600;
}
.calendar-cell {
  background: var(--bg);
  min-height: 80px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background var(--transition);
}
.calendar-cell:hover { background: var(--bg-secondary); }
.calendar-cell-empty { background: #fdfdff; cursor: default; }
.calendar-cell-empty:hover { background: #fdfdff; }
.calendar-cell.today { box-shadow: inset 0 0 0 2px var(--primary); }
.calendar-cell.selected { background: var(--primary-light); }
.calendar-cell .day-num { font-size: 14px; font-weight: 700; color: var(--text); }
.calendar-cell .dots { display: flex; gap: 3px; margin-top: 4px; }
.dot-published { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.dot-scheduled { width: 7px; height: 7px; border-radius: 50%; background: var(--info); }
.dot-draft { width: 7px; height: 7px; border-radius: 50%; background: #c4b5fd; }
.dot-failed { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }

/* ── Dashboard ── */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dashboard-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
}
.dashboard-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.dashboard-card .value { font-size: 32px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.dashboard-card .value.green { color: var(--success); }
.dashboard-card .value.red { color: var(--danger); }
.dashboard-card .value.amber { color: var(--warning); }
.dashboard-card .label { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

.dashboard-welcome {
  padding: 32px;
  background: linear-gradient(135deg, #7c3aed10, #6366f108);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  text-align: center;
}
.dashboard-welcome h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.dashboard-welcome p { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.dashboard-welcome .quick-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Report ── */
.report-post-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.report-post-item:hover { background: var(--bg-secondary); }
.report-post-item:last-child { border-bottom: none; }

.post-rank-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.post-rank-item:last-child { border-bottom: none; }
.post-rank-left { flex: 1; min-width: 0; }
.post-rank-num { font-size: 13px; color: var(--text-secondary); margin-right: 8px; min-width: 28px; }
.post-rank-title { font-weight: 600; cursor: pointer; display: inline; }
.post-rank-title:hover { color: var(--primary); }
.post-rank-platforms { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.post-rank-badge { display: inline-block; margin-right: 8px; }
.post-rank-views { text-align: right; white-space: nowrap; margin-left: 16px; }

/* ── KPI Cards ── */
.dashboard-card .kpi-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.dashboard-card .kpi-value { font-size: 30px; font-weight: 800; color: var(--text); line-height: 1.1; }
.dashboard-card .kpi-value.kpi-good { color: var(--success); }
.dashboard-card .kpi-value.kpi-warn { color: var(--warning); }
.dashboard-card .kpi-value.kpi-bad { color: var(--danger); }

/* ── Trend Bar Chart ── */
.trend-bar-row { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.trend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.trend-bar-count { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.trend-bar { width: 100%; max-width: 40px; background: var(--border); border-radius: 4px 4px 0 0; min-height: 2px; transition: background 0.2s; }
.trend-bar-label { font-size: 11px; color: var(--text-secondary); margin-top: 6px; white-space: nowrap; }

/* ── Platform Cards ── */
.platform-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 8px; }
.platform-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; transition: box-shadow 0.15s;
}
.platform-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.platform-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.platform-card-name { font-weight: 700; font-size: 14px; }
.platform-card-posts { font-size: 12px; color: var(--text-secondary); }
.platform-card-stats { display: flex; gap: 16px; }
.plat-stat { text-align: center; flex: 1; }
.plat-stat-val { display: block; font-size: 20px; font-weight: 700; }
.plat-stat-label { font-size: 11px; color: var(--text-secondary); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── AI Optimize ── */
.optimize-tab {
  padding: 10px 20px;
  border: none; background: none;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.optimize-tab:hover { color: var(--text); }
.optimize-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.optimize-priority {
  display: inline-block;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.optimize-priority-high { background: #fef2f2; color: #dc2626; }
.optimize-priority-medium { background: #fffbeb; color: #d97706; }
.optimize-priority-low { background: #f0fdf4; color: #16a34a; }
.optimize-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.optimize-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Logs ── */
.logs-page { padding: 24px; max-width: 1200px; overflow-y: auto; height: 100%; }

.logs-stats { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.logs-stat-card {
  flex: 1; min-width: 110px; max-width: 180px;
  padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  background: var(--bg);
  transition: box-shadow var(--transition);
}
.logs-stat-card:hover { box-shadow: var(--shadow-sm); }
.logs-stat-card .stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; }
.logs-stat-card .stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stat-total .stat-value { color: var(--primary); }
.stat-success .stat-value { color: var(--success); }
.stat-failed .stat-value { color: var(--danger); }
.stat-pending .stat-value { color: var(--text-secondary); }
.stat-rate .stat-value { color: #7c3aed; }

.logs-filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.logs-filters select,
.logs-filters input { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; outline: none; background: var(--bg); color: var(--text); }
.logs-filters select:focus,
.logs-filters input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.logs-filters input[type="date"] { width: 130px; }
.logs-filters input[type="search"] { width: 180px; }

.logs-table { width: 100%; border-collapse: collapse; }
.logs-table th, .logs-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.logs-table th { font-weight: 600; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.logs-table tr:hover { background: var(--bg-secondary); }
.logs-table a.post-link { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 500; }
.logs-table a.post-link:hover { text-decoration: underline; }
.logs-error-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--danger); font-size: 12px; }

.logs-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 16px; padding: 8px 0; }
.logs-pagination button {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); cursor: pointer; font-size: 13px; transition: all var(--transition);
  color: var(--text);
}
.logs-pagination button:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--primary); }
.logs-pagination button:disabled { opacity: 0.4; cursor: default; }
.logs-pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.logs-pagination .page-info { font-size: 13px; color: var(--text-secondary); margin: 0 8px; }

.logs-error-full {
  display: none;
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 200; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; max-width: 500px; width: 90%;
  box-shadow: var(--shadow-lg);
}
.logs-error-full.show { display: block; animation: slideUp 0.2s ease; }
.logs-error-full h4 { margin-bottom: 12px; font-size: 15px; color: var(--danger); font-weight: 700; }
.logs-error-full pre { white-space: pre-wrap; font-size: 13px; max-height: 300px; overflow-y: auto; background: var(--bg-secondary); padding: 12px; border-radius: 4px; }
.logs-error-full button { margin-top: 12px; }
.logs-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(30,27,75,0.3); z-index: 199; }
.logs-overlay.show { display: block; }

.btn-retry { color: var(--primary); background: none; border: 1px solid var(--primary); padding: 3px 10px; border-radius: 4px; font-size: 12px; cursor: pointer; transition: all var(--transition); }
.btn-retry:hover { background: var(--primary); color: #fff; }
.btn-retry:disabled { opacity: 0.5; cursor: default; }

/* ── Status tabs ── */
.status-tabs {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 0;
}
.status-tab {
  flex: 1; min-width: 0; text-align: center;
  padding: 5px 3px; font-size: 11px; cursor: pointer;
  border-radius: 4px; color: var(--text-secondary);
  background: var(--bg); border: 1px solid transparent;
  transition: all var(--transition); white-space: nowrap;
  font-weight: 500;
}
.status-tab:hover { color: var(--text); background: var(--bg-hover); }
.status-tab.active {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
  font-weight: 600;
}

/* ── Misc ── */
.csdn-hint {
  font-size: 12px; color: #d97706;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: 8px 12px;
  margin-top: 8px; display: flex; align-items: center; gap: 6px;
}

.platform-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.platform-dot.active { background: var(--success); }
.platform-dot.expired { background: var(--danger); }

/* ── Video Upload ── */
.video-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.video-dropzone:hover,
.video-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.video-dropzone-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.video-dropzone-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.video-dropzone-link {
  color: var(--primary);
  text-decoration: underline;
}
.video-dropzone-hint {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 6px;
}
.video-upload-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-light);
  font-size: 13px;
  gap: 8px;
}
.video-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.video-progress {
  padding: 16px 0;
}
.video-progress-bar {
  height: 6px;
  background: var(--bg-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.video-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a78bfa);
  border-radius: 3px;
  width: 100%;
  animation: progressPulse 1.5s ease-in-out infinite;
}
@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.video-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Pro nav item ── */
.nav-item-pro {
  color: var(--primary) !important;
  font-weight: 600;
}
.nav-item-pro::after {
  content: 'PRO';
  font-size: 9px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Onboarding ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.onboarding-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px 36px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease;
}
.onboarding-icon {
  font-size: 56px;
  margin-bottom: 20px;
}
.onboarding-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.onboarding-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
}
.onboarding-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.onboarding-cta {
  font-size: 15px;
  padding: 10px 28px;
}
.onboarding-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  transition: all 0.3s;
}
.onboarding-dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}
.onboarding-dot.done {
  background: #a78bfa;
}
.onboarding-tip {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
}
.onboarding-skip {
  margin-top: 16px;
}
.onboarding-skip a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}
.onboarding-skip a:hover {
  color: var(--primary);
}

/* ── Pricing ── */
.pricing-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.pricing-toggle input { display: none; }
.pricing-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--primary);
  border-radius: 13px;
  cursor: pointer;
  transition: 0.3s;
}
.pricing-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.pricing-toggle input:checked + .pricing-toggle-slider::before {
  transform: translateX(22px);
}
.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .pricing-cards { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
}
.pricing-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  position: relative;
  transition: all 0.3s;
}
.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pricing-card-pro {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(124,58,237,0.12);
}
.pricing-card-current {
  border-color: #22c55e;
  background: #f0fdf4;
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 16px;
  border-radius: 12px;
}
.pricing-card-header {
  text-align: center;
  margin-bottom: 24px;
}
.pricing-price {
  margin-top: 12px;
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
}
.pricing-currency {
  font-size: 22px;
  vertical-align: super;
}
.pricing-period {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
}
.pricing-features li {
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f0ff;
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-card-footer {
  text-align: center;
}
.pricing-btn-upgrade {
  width: 100%;
  font-size: 15px;
  padding: 12px;
}
.pricing-btn-current {
  width: 100%;
  font-size: 15px;
  padding: 12px;
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* ── FAQ ── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  background: #fff;
}
.faq-q {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.faq-a {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Platform Connect Cards ── */
.platform-connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.platform-connect-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
  cursor: default;
}
.platform-connect-card.available {
  cursor: pointer;
}
.platform-connect-card.available:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(124,58,237,0.1);
  transform: translateY(-1px);
}
.platform-connect-card.connected {
  border-color: #bbf7d0;
}
.platform-connect-status {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  padding: 1px 8px;
  border-radius: 10px;
}
.platform-connect-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.platform-connect-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}
.platform-connect-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.platform-connect-account {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.platform-connect-meta {
  margin-bottom: 12px;
}
.platform-connect-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.platform-connect-action {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
}

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

/* ── Responsive touches ── */
@media (max-width: 1200px) {
  .sidebar { width: 200px; min-width: 200px; }
  .editor-left { width: 220px; }
}
