/* ========== DEMO COMMON STYLES ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1f2937;
  line-height: 1.5;
  background: #f1f5f9;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }

/* ========== TOP BAR ========== */
.demo-topbar {
  display: flex;
  align-items: center;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  gap: 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.demo-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  flex-shrink: 0;
}

.demo-logo svg,
.demo-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.demo-logo-highlight {
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Module Tabs */
.demo-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
}

.demo-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  border: none;
  background: none;
}

.demo-tab:hover {
  background: #f1f5f9;
  color: #334155;
}

.demo-tab.active {
  background: #2563EB;
  color: #fff;
}

.demo-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.demo-tab-more {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  border: 1px dashed #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.demo-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  background: #fff;
}

.demo-back:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* ========== LAYOUT ========== */
.demo-layout {
  display: flex;
  height: calc(100vh - 56px);
  margin-top: 56px;
  min-width: 0;
}

/* ========== SIDEBAR ========== */
.demo-sidebar {
  width: 220px;
  min-width: 180px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  padding: 12px 0;
  flex-shrink: 0;
}

.demo-sidebar::-webkit-scrollbar { width: 5px; }
.demo-sidebar::-webkit-scrollbar-track { background: transparent; }
.demo-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.demo-sidebar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.sidebar-group-title {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover {
  background: #f8fafc;
  color: #1e293b;
}

.sidebar-item.active {
  background: #eff6ff;
  color: #2563EB;
  border-left-color: #2563EB;
  font-weight: 600;
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-item.locked {
  color: #94a3b8;
  opacity: 0.7;
}

.sidebar-item.locked .lock-icon {
  margin-left: auto;
  width: 12px;
  height: 12px;
}

/* ========== CONTENT AREA ========== */
.demo-content {
  flex: 1;
  overflow: hidden;
}

.demo-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ========== FULLSCREEN MODE ========== */
.demo-sidebar.hidden {
  display: none;
}

.demo-layout.fullscreen-mode .demo-content {
  width: 100%;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .demo-sidebar {
    width: 180px;
    min-width: 160px;
  }

  .sidebar-item {
    padding: 9px 14px;
    font-size: 12px;
    gap: 8px;
  }

  .sidebar-item svg {
    width: 16px;
    height: 16px;
  }

  .demo-tab {
    padding: 6px 10px;
    font-size: 12px;
  }

  .demo-tab span {
    display: none;
  }
}

@media (max-width: 640px) {
  .demo-sidebar {
    width: 160px;
    min-width: 140px;
  }

  .sidebar-item {
    padding: 8px 10px;
    font-size: 11px;
    gap: 6px;
  }
}
