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

:root {
  --primary: #0ea5e9;
  --primary-hover: #38bdf8;
  --primary-light: #0c4a6e;
  --primary-glow: rgba(14, 165, 233, 0.15);
  --secondary: #10b981;
  --secondary-hover: #34d399;
  --sidebar-bg: #0f1729;
  --sidebar-hover: #1a2d45;
  --sidebar-active: #0ea5e9;
  --sidebar-text: #64748b;
  --sidebar-text-active: #f1f5f9;
  --bg: #0a0f1e;
  --card-bg: #162032;
  --border: #1e2d45;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --danger: #f87171;
  --danger-hover: #ef4444;
  --success: #34d399;
  --warning: #fbbf24;
  --info: #60a5fa;
  --gray: #6b7280;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.25);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* ===== Layout ===== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* ===== Sidebar ===== */
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.sidebar-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-logo-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.2;
  color: #fff;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  letter-spacing: 0.5px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 14px;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(8, 145, 178, 0.12);
  color: var(--sidebar-text-active);
  border-left-color: var(--sidebar-active);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: var(--sidebar-text);
  font-size: 12px;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}

.page-header h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2, .card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* ===== Stats Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.cyan { background: #164e63; color: #22d3ee; }
.stat-icon.green { background: #064e3b; color: #34d399; }
.stat-icon.purple { background: #2e1065; color: #a78bfa; }
.stat-icon.orange { background: #431407; color: #fb923c; }

.stat-info { flex: 1; min-width: 0; }

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
  color: #fbbf24;
  background: #422006;
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.stat-badge:hover {
  background: #713f12;
}

/* ===== Tables ===== */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #1e293b;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #334155;
}

tbody tr.clickable {
  cursor: pointer;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-gray, .badge-draft { background: #334155; color: #94a3b8; }
.badge-green, .badge-active, .badge-approved, .badge-qualified { background: #064e3b; color: #6ee7b7; }
.badge-blue, .badge-completed, .badge-published, .badge-new { background: #1e3a5f; color: #93c5fd; }
.badge-red, .badge-cancelled, .badge-rejected, .badge-lost { background: #450a0a; color: #fca5a5; }
.badge-yellow, .badge-pending, .badge-contacted { background: #422006; color: #fde68a; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--secondary-hover);
  border-color: var(--secondary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-outline-warning {
  color: #d97706;
  border-color: #fbbf24;
  background: transparent;
}
.btn-outline-warning:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.08);
  border-color: #d97706;
}

.btn-outline-danger {
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
}
.btn-outline-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.08);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 6px 8px;
  min-width: 32px;
  justify-content: center;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  color: #f1f5f9;
  background: #1a2d45;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ===== Modals ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

.modal.wide {
  max-width: 640px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: slideIn 0.25s ease;
  min-width: 280px;
}

.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-info { border-left: 3px solid var(--info); }
.toast.toast-warning { border-left: 3px solid var(--warning); }

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-error .toast-icon { color: var(--danger); }
.toast-success .toast-icon { color: var(--success); }
.toast-info .toast-icon { color: var(--info); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-message { flex: 1; color: var(--text); }

.toast-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-family: var(--font);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ===== Filters ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .form-control {
  width: auto;
  min-width: 180px;
}

/* ===== Platform Selector ===== */
.platform-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.platform-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.platform-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.platform-group-label {
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ===== Form Section ===== */
.form-section {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 12px 0 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===== Compliance Item ===== */
.compliance-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(251, 191, 36, 0.08);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.compliance-item i {
  color: var(--warning);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ===== Content Output ===== */
.content-output {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  margin-bottom: 12px;
}

.content-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.content-output-header label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== Loading ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 8px;
}

.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  font-size: 14px;
}

/* ===== Confirm Dialog ===== */
.confirm-dialog .modal {
  max-width: 400px;
}

.confirm-dialog .modal-body {
  text-align: center;
  padding: 32px 24px;
}

.confirm-dialog .modal-body i {
  font-size: 48px;
  color: var(--warning);
  margin-bottom: 16px;
}

.confirm-dialog .modal-body p {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.confirm-dialog .modal-body .hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Page Visibility ===== */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ===== File Upload Area ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fafbfc;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area i {
  font-size: 36px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.upload-area p {
  color: var(--text-secondary);
  font-size: 14px;
}

.upload-area .hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

/* ===== Checkbox Toggle ===== */
.toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: #d1d5db;
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  padding: 0;
}

.toggle.active {
  background: var(--primary);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.toggle.active::after {
  transform: translateX(18px);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Action buttons in tables */
.action-btns {
  display: flex;
  gap: 4px;
}

/* Review actions */
.review-actions {
  display: flex;
  gap: 8px;
}

/* Detail section */
.detail-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}

.detail-grid dt {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-grid dd {
  color: var(--text);
}

/* Responsive tweaks */
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Copy button styling */
.copy-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
  font-family: var(--font);
}

.copy-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* ===== Forum / Community ===== */
.modal-lg {
  max-width: 720px !important;
}

.forum-category-list {
  display: grid;
  gap: 12px;
}

.forum-category-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
}

.forum-category-card:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--card-bg));
}

.forum-category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.forum-category-info {
  flex: 1;
  min-width: 0;
}

.forum-category-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text);
}

.forum-category-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.forum-category-stats {
  text-align: right;
  flex-shrink: 0;
}

.forum-category-stats .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.forum-category-stats .label {
  font-size: 12px;
  color: var(--text-muted);
}

.forum-last-post {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Topic List */
.forum-topic-list {
  width: 100%;
}

.forum-topic-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.forum-topic-item:hover {
  background: color-mix(in srgb, var(--primary) 3%, transparent);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: var(--radius);
}

.forum-topic-item.is-pinned {
  background: color-mix(in srgb, #f59e0b 5%, transparent);
  border-radius: var(--radius);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}

.forum-topic-main {
  flex: 1;
  min-width: 0;
}

.forum-topic-main h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-topic-main .meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.forum-topic-main .meta i {
  margin-right: 3px;
}

.forum-topic-stats {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.forum-topic-stats .stat-num {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.forum-topic-stats .stat-label {
  font-size: 11px;
}

/* Breadcrumb */
.forum-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.forum-breadcrumb a {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}

.forum-breadcrumb a:hover {
  text-decoration: underline;
}

/* Topic Detail */
.forum-topic-detail {
  max-width: 100%;
}

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

.forum-topic-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.forum-topic-header .meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.forum-topic-header .meta i {
  margin-right: 4px;
}

.forum-topic-body {
  padding: 16px 0;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.forum-post {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
}

.forum-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}

.forum-post-author {
  font-weight: 600;
  color: var(--text);
}

.forum-post-role {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
}

.forum-post-time {
  color: var(--text-muted);
  font-size: 12px;
}

.forum-post-body {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.forum-post-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.forum-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}

.forum-like-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.forum-like-btn.liked {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.forum-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.forum-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.forum-empty p {
  font-size: 15px;
}

/* Pagination */
.forum-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.forum-pagination button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}

.forum-pagination button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.forum-pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Forum stats bar */
.forum-stats-bar {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.forum-stats-bar strong {
  color: var(--text);
}

/* ===== Brand Footer ===== */
.brand-footer {
  position: fixed;
  bottom: 12px;
  right: 20px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.4;
  pointer-events: none;
  letter-spacing: 0.3px;
  z-index: 1;
}

.brand-footer-dot {
  margin: 0 4px;
}

/* ===== Auth Modal Beautify ===== */
#auth-modal .modal {
  background: linear-gradient(145deg, var(--card-bg), #1a2a40);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

#auth-modal .modal-header {
  border-bottom-color: rgba(14, 165, 233, 0.1);
}

#auth-modal .modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Auth / Logout Styles ===== */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--danger);
}

/* Public-only nav items (visible when not logged in) */
.public-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

.public-nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.public-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

/* ===== Mobile Header & Overlay ===== */
.mobile-header {
  display: none;
  align-items: center;
  padding: 10px 16px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  min-height: 50px;
  z-index: 100;
}
.mobile-header-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* Mobile toggle menu button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.05); }

.mobile-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.mobile-login-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}
.mobile-login-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.mobile-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s;
}
.mobile-user-avatar:hover {
  opacity: 0.8;
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { width: 80%; }
}

/* ===== Responsive: Mobile (768px) ===== */
@media (max-width: 768px) {
  /* Sidebar becomes a slide-out drawer */
  .app-layout { flex-direction: column; }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 20px rgba(0,0,0,0.5);
  }
  .sidebar.open { left: 0; }

  /* Main content takes full width */
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header h1 { font-size: 18px; }

  /* Tables become scrollable */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { font-size: 12px; }
  th, td { padding: 8px 6px; white-space: nowrap; }

  /* Modals fill screen */
  .modal {
    width: 92%;
    max-height: 85vh;
    margin: 0;
  }
  .modal-overlay.active .modal {
    top: 5vh !important;
    transform: none !important;
  }

  /* Cards */
  .card-body { padding: 14px; }

  /* Form rows stack vertically */
  .form-row { flex-direction: column; }
  .form-group { margin-bottom: 12px; }

  /* Buttons */
  .btn { padding: 8px 14px; font-size: 13px; }
  .action-btns { flex-wrap: nowrap; }

  /* Tabs */
  .tabs { overflow-x: auto; white-space: nowrap; }
  .tabs .tab { padding: 8px 14px; font-size: 13px; }

  /* Platform selector (uses flex-wrap, switch to 2-col) */
  .platform-selector { gap: 6px; }
  .platform-selector .platform-btn { padding: 8px; font-size: 12px; }

  /* Filter bar */
  .filter-bar { flex-direction: column; gap: 8px; }

  /* Forum */
  .forum-category-card { flex-direction: column; gap: 8px; }
  .forum-category-stats { flex-direction: row; }
  .forum-topic-item { flex-direction: column; gap: 8px; }
  .forum-topic-stats { justify-content: flex-start; }
  .forum-stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
  }
  .forum-breadcrumb { font-size: 12px; }

  /* Content output */
  .content-output {
    max-height: 300px;
    font-size: 12px;
    padding: 12px;
  }

  /* File upload area */
  .upload-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Confirm dialog */
  .confirm-dialog .modal { width: 85%; }

  /* Studio layout */
  .studio-layout { grid-template-columns: 1fr; }

  /* Share panel */
  .share-platform-grid { grid-template-columns: 1fr; }

  /* Logo footer */
  .brand-footer { display: none; }

  /* Mobile toggle menu button */
  .mobile-menu-btn {
    display: flex !important;
  }
}

/* ===== Mobile Login Overhaul ===== */
@media (max-width: 768px) {
  #auth-modal .modal-overlay.active {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  #auth-modal .modal {
    width: 88%;
    max-width: 380px;
    background: linear-gradient(160deg, #1a2a40 0%, #0f1928 100%);
    border: 1px solid rgba(14, 165, 233, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(14, 165, 233, 0.05);
    animation: loginSlideUp 0.35s ease;
    overflow: hidden;
  }

  @keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Brand area at top */
  #auth-modal .modal-header {
    padding: 28px 24px 16px;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
  }

  #auth-modal .modal-header::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
    pointer-events: none;
  }

  #auth-modal .modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #38bdf8, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  #auth-modal .auth-brand-logo {
    display: block !important;
    width: 42px;
    height: 42px;
    margin-bottom: 4px;
  }

  #auth-modal .modal-header::after {
    content: '口腔医疗AI工作台';
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
    letter-spacing: 2px;
  }

  #auth-modal .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    transition: all 0.2s;
  }
  #auth-modal .modal-close:hover,
  #auth-modal .modal-close:active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  /* Body spacing */
  #auth-modal .modal-body {
    padding: 8px 24px 28px;
  }

  /* Input groups with icons */
  #auth-modal .form-group {
    position: relative;
    margin-bottom: 16px !important;
  }

  #auth-modal .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  #auth-modal .form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    transition: all 0.25s;
    outline: none;
  }

  #auth-modal .form-control:focus {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.06);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
  }

  #auth-modal .form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-size: 14px;
  }

  /* Buttons area */
  #auth-modal .form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

  #auth-modal .btn-primary {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    border: none;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
    transition: all 0.25s;
    letter-spacing: 1px;
  }

  #auth-modal .btn-primary:hover:not(:disabled),
  #auth-modal .btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
  }

  #auth-modal .btn-outline {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    transition: all 0.2s;
  }

  #auth-modal .btn-outline:hover:not(:disabled),
  #auth-modal .btn-outline:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
  }

  /* Divider between login and register */
  #auth-modal .form-actions .btn-outline:first-child {
    order: 2;
    margin-top: 4px;
  }

  #auth-modal .form-actions .btn-primary:last-child {
    order: 1;
  }

  /* Register form adjustments */
  #auth-modal #auth-register-form .form-actions {
    margin-top: 12px;
  }
}
@media (max-width: 480px) {
  .page-content { padding: 12px; }
  .stats-grid { grid-template-columns: 1fr; }
  .platform-selector { flex-direction: column; }
  .forum-stats-bar { grid-template-columns: repeat(3, 1fr); }
  .stat-value { font-size: 20px; }
  h1 { font-size: 16px; }
  .upload-preview-grid { grid-template-columns: 1fr; }
  .badge { font-size: 10px; padding: 2px 6px; }
}

/* ===== Video Studio Layout ===== */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.studio-panel {
  min-width: 0;
}
.studio-input-panel {
  /* left panel */
}
.studio-preview-panel {
  /* right panel */
}
.btn-block {
  width: 100%;
  justify-content: center;
}
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.video-placeholder {
  background: var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  aspect-ratio: 16/9;
}
.video-placeholder i {
  font-size: 48px;
  color: var(--primary);
  margin-bottom: 12px;
}
.video-placeholder p {
  color: var(--text-secondary);
  font-size: 16px;
}

/* Scene Items */
.scene-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.02);
}
.scene-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.scene-info {
  flex: 1;
  min-width: 0;
}
.scene-time {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 4px;
}
.scene-desc {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.scene-dialog {
  font-size: 13px;
  color: var(--secondary);
  margin-top: 4px;
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 4px;
}
.scene-prompt {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* Share Panel */
.share-platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.share-platform-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--card-bg);
  transition: border-color 0.2s;
}
.share-platform-card:hover {
  border-color: var(--primary);
}
.share-platform-header {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
}
.share-platform-header i {
  margin-right: 8px;
}
.share-platform-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.share-platform-embed {
  font-size: 12px;
  color: var(--text-muted);
}
.share-platform-embed code {
  display: block;
  font-size: 11px;
  padding: 6px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  margin-top: 4px;
  max-height: 60px;
  overflow: hidden;
  word-break: break-all;
}
.input-with-copy {
  display: flex;
  gap: 8px;
}
.input-with-copy input {
  flex: 1;
}
.btn-sm {
  font-size: 12px;
  padding: 6px 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  color: var(--text-muted);
}
.empty-state p {
  font-size: 15px;
}

/* Dashboard: Stats row with chart + content */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.card-chart {
  min-width: 0;
}
@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr; }
}

/* Pure CSS Bar Chart */
.chart-container {
  min-height: 180px;
}
.chart-bar-group {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  padding: 10px 0;
  gap: 4px;
}
.chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 28px;
}
.chart-bar-track {
  flex: 1;
  width: 28px;
  background: #f3f4f6;
  border-radius: 4px 4px 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.chart-bar-fill {
  width: 100%;
  background: linear-gradient(to top, var(--primary), #60a5fa);
  border-radius: 4px 4px 0 0;
  transition: height .3s ease;
  min-height: 2px;
}
.chart-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  white-space: nowrap;
}
.chart-bar-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* Badge colors */
.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}
.badge-warning {
  background: rgba(251, 191, 36, 0.2);
  color: var(--warning);
}
.badge-danger {
  background: rgba(248, 113, 113, 0.2);
  color: var(--danger);
}

/* Batch action bar */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: -1px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.batch-bar .btn {
  white-space: nowrap;
}
#content-selected-count {
  font-weight: 600;
  color: var(--text);
  min-width: 24px;
}

/* Version History */
.version-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.version-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
}
.version-item:hover {
  background: #f1f5f9;
}
.version-badge {
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
}
.version-date {
  color: var(--text-muted);
  font-size: 12px;
  flex: 1;
}
.version-action {
  color: var(--primary);
  font-size: 12px;
}
.version-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.version-compare-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.version-compare-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}
.version-compare-old .version-compare-header {
  color: #dc2626;
}
.version-compare-new .version-compare-header {
  color: var(--success);
}
.version-compare-panel pre {
  margin: 0;
  padding: 12px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* Asset Thumbnails */
.asset-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  transition: transform .15s, box-shadow .15s;
}
.asset-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-thumb i {
  font-size: 20px;
  color: var(--text-muted);
}
.asset-thumb.video-thumb i {
  color: var(--primary);
  font-size: 24px;
}
.asset-thumb.doc-thumb i {
  color: #dc2626;
}
.asset-thumb.generic-thumb i {
  color: #9ca3af;
}
#assets-table .table td:first-child {
  width: 60px;
  text-align: center;
}

/* Markdown Editor */
.md-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.md-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.md-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all .15s;
  line-height: 1;
}
.md-btn:hover {
  background: #e2e8f0;
  color: var(--text);
}
.md-btn i { font-size: 14px; }
.md-btn b { font-weight: 700; font-size: 14px; }
.md-btn-preview {
  color: var(--primary);
  font-size: 12px;
}
.md-btn-preview:hover {
  background: rgba(14,165,233,0.1);
}
.md-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  display: inline-block;
}
.md-textarea {
  border: none !important;
  border-radius: 0 !important;
  resize: vertical;
  min-height: 120px;
}
.md-preview {
  display: none;
  min-height: 120px;
}
.md-preview-header {
  padding: 8px 12px;
  background: #f0fdf4;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--success);
}
.md-preview-body {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.md-preview-body h1 { font-size: 20px; margin: 12px 0 8px; }
.md-preview-body h2 { font-size: 17px; margin: 10px 0 6px; }
.md-preview-body h3 { font-size: 15px; margin: 8px 0 4px; }
.md-preview-body p { margin: 0 0 8px; }
.md-preview-body ul, .md-preview-body ol { padding-left: 20px; margin: 4px 0 8px; }
.md-preview-body li { margin: 2px 0; }
.md-preview-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #e11d48;
}
.md-preview-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}
.md-preview-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.md-preview-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 8px 16px;
  margin: 8px 0;
  background: #f8fafc;
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
}
.md-preview-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.md-preview-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}

/* Responsive: Studio */
@media (max-width: 1024px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
  .share-platform-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== Skeleton Loader ===== */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
}
.skeleton-text { height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 16px; }
.skeleton-card { height: 120px; width: 100%; margin-bottom: 16px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.3;
}
.empty-state p {
  font-size: 15px;
  line-height: 1.6;
}
.empty-state .btn {
  margin-top: 16px;
}
