/* 侧边栏 */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-normal);
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-lg) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-secondary);
  height: var(--header-height);
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-logo svg {
  width: 100%;
  height: 100%;
  fill: white;
}

.sidebar-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-sm) var(--space-sm);
  overflow-y: auto;
}

.sidebar-footer {
  padding: var(--space-sm);
  border-top: 1px solid var(--border-secondary);
}

.nav-section {
  margin-bottom: var(--space-md);
}

.nav-section-title {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-muted);
  color: var(--accent-hover);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg {
  opacity: 1;
}

/* 主内容列（横幅 + 内容区） */
#main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* 主内容区 */
#content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
}

.page {
  padding: var(--space-xl) var(--space-2xl);
  max-width: 1200px;
  animation: pageIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-header {
  margin-bottom: var(--space-xl);
}

.page-header:has(.page-actions) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.page-desc {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

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

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

.page-exit {
  animation: pageOut 100ms ease forwards;
  pointer-events: none;
}

/* Setup 页面版本选择卡片 */
.setup-source-option {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.setup-source-option:hover {
  border-color: var(--accent);
  background: var(--bg-glass-hover);
}

.setup-source-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-muted);
}

/* Gateway 未启动引导横幅 */
.gw-banner {
  background: var(--warning, #f59e0b);
  color: #000;
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  z-index: 100;
  transition: all 300ms ease;
  overflow: hidden;
  max-height: 50px;
}
.gw-banner-hidden {
  max-height: 0;
  padding: 0 16px;
  opacity: 0;
}
.gw-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gw-banner-icon {
  font-size: 16px;
}
.gw-banner .btn {
  margin-left: auto;
  background: rgba(0,0,0,0.15);
  border: none;
  color: #000;
  font-weight: 600;
}
