/* yt-publish 全局样式 - 简洁现代 + 移动适配 */
:root {
  --bg: #f5f7fb;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --soft: #f1f5f9;
  --primary: #ef4444;            /* YouTube 红 */
  --primary-dark: #dc2626;
  --primary-soft: #fee2e2;
  --success: #10b981;
  --success-soft: #d1fae5;
  --danger: #ef4444;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --info: #3b82f6;
  --info-soft: #dbeafe;
  --grad: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 100vh;
}
button, input, textarea, select { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--border); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; padding-left: 30px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 15px; margin-bottom: 4px; border: none; background: transparent; width: 100%; text-align: left; font-weight: 500; min-height: 44px; }
.nav-item:hover { background: var(--soft); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.main { flex: 1; min-width: 0; padding: 24px 32px; max-width: 1280px; width: 100%; margin: 0 auto; }
.topbar { display: none; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px; position: sticky; top: 0; z-index: 50; align-items: center; justify-content: space-between; gap: 10px; }
.topbar-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.bottom-tab { padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; cursor: pointer; border: none; background: transparent; min-height: 54px; }
.bottom-tab.active { color: var(--primary); }

/* Header sections */
h1.page-title { font-size: 24px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.section-title { font-size: 16px; font-weight: 600; margin: 20px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Welcome banner */
.welcome { background: linear-gradient(135deg, #fee2e2 0%, #fef3c7 100%); border-radius: 16px; padding: 20px 24px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.welcome-text h2 { font-size: 20px; margin-bottom: 4px; }
.welcome-text p { color: var(--muted); font-size: 14px; }

/* Connect card */
.connect-card { background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 20px; text-align: center; }
.connect-card h2 { font-size: 18px; margin-bottom: 8px; }
.connect-card p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* Channel info */
.channel-card { background: #fff; border-radius: 14px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 20px; display: flex; align-items: center; gap: 14px; }
.channel-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; overflow: hidden; }
.channel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 16px; font-weight: 600; }
.channel-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 700; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Buttons */
.btn { padding: 8px 14px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.15s; }
.btn:hover:not(:disabled) { opacity: 0.88; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--soft); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-icon { padding: 8px; min-width: 40px; justify-content: center; }
.btn-sm { padding: 6px 10px; font-size: 13px; min-height: 36px; }
.btn-lg { padding: 12px 24px; font-size: 16px; min-height: 50px; }
.fab { position: fixed; bottom: 80px; right: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--grad); color: #fff; border: none; font-size: 24px; cursor: pointer; box-shadow: 0 4px 12px rgba(239,68,68,0.4); z-index: 40; display: flex; align-items: center; justify-content: center; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-tab { padding: 6px 12px; border-radius: 16px; font-size: 13px; border: 1px solid var(--border); background: #fff; cursor: pointer; color: var(--muted); min-height: 36px; }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kanban-col { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); min-height: 200px; }
.kanban-col-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.kanban-col-title .count { background: var(--soft); color: var(--muted); padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.kanban-card { background: var(--bg); border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 13px; line-height: 1.45; cursor: grab; }
.kanban-card.draft { border-left: 3px solid var(--muted); }
.kanban-card.scheduled { border-left: 3px solid var(--warning); }
.kanban-card.published { border-left: 3px solid var(--success); }
.kanban-card .title { font-weight: 500; margin-bottom: 4px; word-break: break-word; }
.kanban-card .meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }

/* Video cards (list view) */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.video-card { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; gap: 12px; cursor: pointer; transition: transform 0.15s; }
.video-card:hover { transform: translateY(-2px); }
.video-thumb { width: 120px; height: 68px; border-radius: 8px; background: var(--soft); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-info { flex: 1; min-width: 0; }
.video-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.privacy-pill { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.privacy-pill.public { background: var(--success-soft); color: #065f46; }
.privacy-pill.private { background: var(--info-soft); color: #1e40af; }
.privacy-pill.unlisted { background: var(--warning-soft); color: #92400e; }

/* Forms */
.form-section { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 12px; }
.form-section h3 { font-size: 15px; margin-bottom: 10px; }
.form-row { display: grid; gap: 10px; margin-bottom: 10px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
input[type="text"], input[type="date"], input[type="url"], textarea, select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; width: 100%; background: #fff; }
textarea { resize: vertical; min-height: 80px; font-family: inherit; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* Upload progress */
.upload-progress { background: var(--info-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.progress-bar-bg { background: rgba(255,255,255,0.5); height: 6px; border-radius: 3px; overflow: hidden; margin: 6px 0; }
.progress-bar-fill { background: var(--info); height: 100%; transition: width 0.2s; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 20px; max-width: 480px; width: 100%; max-height: 85vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.modal h3 { font-size: 17px; margin-bottom: 10px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions button { flex: 1; min-height: 44px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.modal-actions .btn-cancel { background: var(--soft); color: var(--text); }
.modal-actions .btn-confirm { background: var(--danger); color: #fff; }
.modal-actions .btn-primary-action { background: var(--primary); color: #fff; }

/* Empty */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; }
.empty svg { margin-bottom: 12px; opacity: 0.4; }

/* Toast */
#toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(15,23,42,0.92); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; z-index: 200; display: none; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
#toast.show { display: block; animation: toastIn 0.2s; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Backup banner */
.backup-banner { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fde68a; color: #92400e; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 768px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { display: flex; }
  .bottom-nav { display: block; }
  .main { padding: 14px 12px 90px; }
  h1.page-title { font-size: 18px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .form-row.two { grid-template-columns: 1fr; }
  .fab { bottom: 74px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 180px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
