* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body {
  background-color: var(--fj-bg-root);
  color: var(--fj-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
.fj-container {
  max-width: var(--fj-page-max-width, 1200px);
  margin: 0 auto;
  padding: 0 var(--fj-page-padding-x, 32px);
}

.fj-header {
  position: sticky; top: 0; z-index: 100; height: 64px;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--fj-border-subtle);
}
[data-theme="light"] .fj-header {
  background-color: var(--fj-bg-root);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.fj-logo { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.fj-logo-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: url("/luntan/assets/logo-real.png") center / cover no-repeat;
}
.fj-layout-dashboard {
  display: grid;
  grid-template-columns: var(--fj-golden-sidebar-width, 220px) minmax(0, 1fr);
  gap: var(--fj-golden-layout-gap, 48px);
  padding-top: 40px;
  padding-bottom: 0;
  align-items: start;
}
.fj-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 24px;
  align-self: start;
}
.fj-card {
  background: var(--fj-bg-surface); border: 1px solid var(--fj-border-base); border-radius: 12px;
  box-shadow: var(--fj-shadow-card); padding: 20px;
}
.fj-card-title { font-size: 0.85rem; margin-bottom: 12px; color: var(--fj-text-primary); }
.fj-empty { color: var(--fj-text-tertiary); font-size: 13px; }
.fj-select {
  border: 1px solid var(--fj-border-base);
  background: var(--fj-bg-surface);
  color: var(--fj-text-primary);
  border-radius: 8px;
  padding: 8px 10px;
}
.fj-sponsor-feed { display: flex; flex-direction: column; gap: 10px; }
.fj-sponsor-item { display: flex; gap: 10px; align-items: flex-start; }
.fj-sponsor-avatar {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--fj-border-base);
  background: var(--fj-bg-hover) center / cover no-repeat; flex-shrink: 0;
}
.fj-sponsor-line { color: var(--fj-text-secondary); font-size: 13px; line-height: 1.4; }
.fj-sponsor-line b { color: var(--fj-orange-500); font-weight: 600; }
.fj-sponsor-time { color: var(--fj-text-tertiary); font-size: 12px; margin-top: 2px; }

.fj-author-feed-placeholder {
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px dashed var(--fj-border-base);
  background: color-mix(in srgb, var(--fj-bg-hover) 65%, transparent);
}
.fj-author-feed-placeholder-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fj-text-primary);
  margin-bottom: 6px;
}
.fj-author-feed-placeholder-desc {
  font-size: 0.78rem;
  color: var(--fj-text-secondary);
  line-height: 1.5;
}

.fj-author-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.fj-author-avatar {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--fj-border-base);
  background: var(--fj-bg-hover) center / cover no-repeat;
}
.fj-author-name { font-size: 1rem; font-weight: 600; color: var(--fj-text-primary); }
.fj-author-role {
  font-size: 0.75rem; color: var(--fj-orange-500); background: var(--fj-orange-bg);
  padding: 2px 6px; border-radius: 4px; display: inline-block; margin-top: 4px;
}

.fj-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
  transition: all var(--fj-duration-fast) var(--fj-ease-out);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.fj-btn:active { transform: scale(0.96); }
.fj-btn-primary { background: var(--fj-orange-500); color: #fff; }
.fj-btn-primary:hover { background: var(--fj-orange-400); }
.fj-btn-ghost { background: transparent; color: var(--fj-text-secondary); border: 1px solid transparent; }
.fj-btn-ghost:hover { background: var(--fj-bg-hover); color: var(--fj-text-primary); }
.fj-btn-danger { color: #ef4444; }
.fj-bordered { border: 1px solid var(--fj-border-base); }

.fj-quota-list { display: flex; flex-direction: column; gap: 14px; }
.fj-quota-item { display: flex; flex-direction: column; gap: 6px; }
.fj-quota-header { display: flex; justify-content: space-between; font-size: 0.8rem; }
.fj-quota-label { color: var(--fj-text-secondary); }
.fj-quota-value { color: var(--fj-text-primary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fj-progress-track { width: 100%; height: 3px; background: var(--fj-bg-hover); border-radius: 2px; overflow: hidden; }
.fj-progress-fill { height: 100%; width: 0%; background: var(--fj-text-secondary); border-radius: 2px; transition: width 0.4s ease-out; }
.fj-hint { margin-top: 12px; font-size: 12px; color: var(--fj-text-tertiary); }
.fj-sidebar-footer { display: flex; flex-direction: column; gap: 8px; }
.fj-sidebar-footer .fj-btn { justify-content: flex-start; }

.fj-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 30px; }
.fj-kpi-card { min-height: 128px; display: flex; flex-direction: column; gap: 4px; }
.fj-kpi-label { font-size: 0.85rem; color: var(--fj-text-secondary); }
.fj-kpi-value {
  font-size: 2rem; font-weight: 700; line-height: 1.2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.fj-kpi-value.is-orange { color: var(--fj-orange-500); }
.fj-kpi-action { margin-top: auto; border: 1px solid var(--fj-border-base); font-size: 0.75rem; }

.fj-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.fj-section-title { font-size: 1rem; font-weight: 600; color: var(--fj-text-primary); }

.fj-heatmap-container { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 34px; }
.fj-heatmap-grid { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.fj-heat-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--fj-bg-hover); }
.fj-heat-lvl-1 { background: rgba(255, 107, 53, 0.3); }
.fj-heat-lvl-2 { background: rgba(255, 107, 53, 0.55); }
.fj-heat-lvl-3 { background: rgba(255, 107, 53, 0.75); }
.fj-heat-lvl-4 { background: var(--fj-orange-500); }
.fj-heat-stats { flex-shrink: 0; text-align: right; }
.fj-heat-num { font-size: 1.5rem; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fj-heat-desc { font-size: 0.75rem; color: var(--fj-text-secondary); }

.fj-table-card { padding: 0; overflow: hidden; }
.fj-data-table { width: 100%; border-collapse: collapse; text-align: left; }
.fj-data-table th {
  font-size: 0.8rem; color: var(--fj-text-tertiary); font-weight: 500;
  padding: 12px 16px; border-bottom: 1px solid var(--fj-border-subtle);
}
.fj-data-table td {
  padding: 16px; border-bottom: 1px solid var(--fj-border-subtle);
  font-size: 0.9rem; color: var(--fj-text-secondary);
}
.fj-data-row:hover td { background: var(--fj-bg-hover); color: var(--fj-text-primary); }
.fj-data-row:last-child td { border-bottom: none; }
.fj-td-title { color: var(--fj-text-primary); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.fj-post-status {
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; background: var(--fj-bg-hover); color: var(--fj-text-secondary);
}
.fj-post-status.published { color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.fj-td-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fj-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--fj-duration-fast); justify-content: flex-end; }
.fj-data-row:hover .fj-row-actions { opacity: 1; }
.fj-action-icon {
  padding: 6px; border-radius: 6px; color: var(--fj-text-tertiary); border: 1px solid transparent; background: transparent;
}
.fj-action-icon:hover { background: var(--fj-bg-surface); color: var(--fj-text-primary); border-color: var(--fj-border-subtle); }
.fj-action-icon.delete:hover { color: #ef4444; border-color: rgba(239, 68, 68, 0.25); }

@media (max-width: 1024px) {
  .fj-layout-dashboard { grid-template-columns: 1fr; gap: 24px; }
  .fj-sidebar { position: static; }
  .fj-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.toast-host {
  position: fixed; top: 84px; right: 20px; z-index: 2100;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast-item {
  min-width: 220px; max-width: 360px; border-radius: 10px; border: 1px solid var(--fj-border-base);
  background: var(--fj-bg-surface); box-shadow: var(--fj-shadow-card);
  transform: translateY(-4px); opacity: 0; animation: fj-toast-in 180ms var(--fj-ease-out) forwards;
}
.toast-item-inner { padding: 10px 12px; color: var(--fj-text-primary); font-size: 13px; border-left: 2px solid var(--fj-border-hover); }
.toast-item--success .toast-item-inner { border-left-color: rgba(34, 197, 94, 0.7); }
.toast-item--error .toast-item-inner { border-left-color: var(--fj-orange-500); }
.toast-item--info .toast-item-inner { border-left-color: var(--fj-border-hover); }
.toast-item.leaving { animation: fj-toast-out 180ms var(--fj-ease-out) forwards; }
@keyframes fj-toast-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fj-toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-4px); } }

.fj-modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  display: none; align-items: center; justify-content: center; z-index: 2200;
}
.fj-modal.show { display: flex; }
.fj-modal-card {
  width: min(720px, calc(100vw - 40px)); background: var(--fj-bg-surface);
  border: 1px solid var(--fj-border-base); border-radius: 12px; box-shadow: var(--fj-shadow-card);
  padding: 16px;
}
.fj-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fj-modal-head h3 { font-size: 16px; color: var(--fj-text-primary); }
.fj-changelog-editor {
  width: 100%; min-height: 220px; border: 1px solid var(--fj-border-base); border-radius: 8px;
  background: var(--fj-bg-root); color: var(--fj-text-primary); padding: 12px; margin-top: 8px; resize: vertical;
}
.fj-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.fj-recent-scripts {
  padding: 16px 20px;
  margin-bottom: 8px;
}
.fj-recent-scripts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fj-recent-scripts-list a {
  color: var(--fj-text-primary);
  font-weight: 600;
}
.fj-recent-scripts-list a:hover {
  color: var(--fj-orange-500);
}
.fj-recent-scripts-meta {
  font-size: 0.8rem;
  color: var(--fj-text-tertiary);
  margin-left: 6px;
}
