/* 侧边栏样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background: #f8f9fa;
  overflow-x: hidden;
}

.sidebar-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 100%;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 600;
}

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

.icon-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.3);
}

.sidebar-nav {
  display: flex;
  background: white;
  border-bottom: 1px solid #e1e5e9;
  overflow-x: auto;
}

.nav-item {
  flex: 1;
  min-width: 0;
  padding: 12px 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.nav-item.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.nav-item:hover {
  background: #f8f9fa;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-icon {
  font-size: 24px;
  margin-right: 12px;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #667eea;
}

.stat-label {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.quick-actions h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #2c3e50;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  padding: 12px 16px;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: #f8f9fa;
  border-color: #667eea;
}

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

.section-header h3 {
  margin: 0;
  font-size: 16px;
  color: #2c3e50;
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
}

.element-tree,
.resource-list,
.storage-content {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.performance-metrics {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 16px;
}

.metric {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
}

.metric:last-child {
  border-bottom: none;
}

.storage-tabs {
  display: flex;
  background: white;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.storage-tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 2px solid transparent;
}

.storage-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.sidebar-footer {
  background: white;
  border-top: 1px solid #e1e5e9;
  padding: 12px 16px;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

@media (max-width: 300px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-item {
    font-size: 11px;
    padding: 10px 4px;
  }
}