:root {
  --sidebar-width: 260px;
  --topbar-height: 64px;
  
  /* Modern Professional Palette */
  --bg-main: #f4f7fa;
  --bg-sidebar: #1a2233;
  --sidebar-hover: #2d3a54;
  --sidebar-active: #3b82f6;
  --text-sidebar: #a3b1cc;
  --text-sidebar-active: #ffffff;
  
  --panel-bg: #ffffff;
  --panel-border: #e2e8f0;
  --panel-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --brand-primary: #3b82f6;
  --brand-hover: #2563eb;
  --brand-soft: #eff6ff;
  
  --accent-orange: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s ease;
  z-index: 100;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--brand-primary);
}

.nav-group {
  flex: 1;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background-color: var(--sidebar-active);
  color: var(--text-sidebar-active);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

/* Main Content Area */
.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.topbar {
  height: var(--topbar-height);
  background-color: #fff;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.page-title h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-display {
  background: var(--brand-soft);
  color: var(--brand-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Page Content */
.content-area {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Grid Layouts */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stats-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
}

.stats-card .label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.stats-card .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: "Space Grotesk", sans-serif;
}

.stats-card .trend {
  margin-top: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend.up { color: var(--accent-green); }

/* Panels */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

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

.panel-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.panel-body {
  padding: 24px;
}

/* Dashboard Specific */
.dashboard-main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* Feed List */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-item {
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}

.feed-item:hover {
  border-color: var(--brand-primary);
}

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

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-green { background: #dcfce7; color: #166534; }

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

.feed-content {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.feed-relevance {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
}

/* Hot Targets */
.hot-target-list {
  display: flex;
  flex-direction: column;
}

.hot-target-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.hot-target-item:last-child {
  border-bottom: 0;
}

.rank-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 16px;
}

.rank-num.top3 {
  background: var(--brand-soft);
  color: var(--brand-primary);
}

.target-info {
  flex: 1;
}

.target-name {
  font-size: 14px;
  font-weight: 600;
}

.target-score {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-green);
}

/* Video Lab */
.video-lab-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  height: calc(100vh - var(--topbar-height) - 100px);
}

.video-scroll-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 8px;
}

.video-card {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.video-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.video-card.active {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.video-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card .meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.video-detail-view {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.video-detail-header {
  padding: 24px;
  border-bottom: 1px solid var(--panel-border);
}

.video-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-section p {
  font-size: 15px;
  line-height: 1.7;
}

.sensitive-list {
  list-style: none;
}

.sensitive-list li {
  padding: 10px 14px;
  background: #fff1f2;
  border-left: 4px solid var(--accent-red);
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 14px;
  color: #9f1239;
}

/* Settings & Controls */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

input, select, textarea {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
}

input:focus, select:focus {
  background: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background: var(--brand-hover);
}

button.secondary {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid #e2e8f0;
}

button.secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

button.danger {
  background: #fee2e2;
  color: #b91c1c;
}

button.danger:hover {
  background: #fecaca;
}

/* Settings Page */
.settings-tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 32px;
}

.settings-tab-btn {
  background: none;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  padding: 12px 0;
  border-radius: 0;
  font-size: 15px;
}

.settings-tab-btn:hover {
  color: var(--text-primary);
  background: none;
}

.settings-tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: none;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.target-item-card {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.target-item-info h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.target-item-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

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

/* Forms */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 24px;
}

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

.content-area > * {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
  }
  .sidebar .logo, .sidebar .nav-item span {
    display: none;
  }
  .sidebar .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-main-content {
    grid-template-columns: 1fr;
  }
  .video-lab-container {
    grid-template-columns: 1fr;
  }
}
