body {
  width: 290px;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f9fafb;
  padding: 8px;
}

.popup-container {
  background: #f9fafb;
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  padding-right: 24px;
  cursor: pointer;
  transition: background-color 0.2s;
  color: #333;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
}

.menu-item:hover {
  background-color: #f5f5f5;
}

.groups-title {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  font-weight: 600;
  margin-top: 8px;
  background-color: #fff;
  border-radius: 8px 8px 0 0;
}

.menu-icon {
  margin-right: 8px;
  font-size: 16px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.menu-icon svg {
  width: 16px;
}

.menu-text {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.status-text {
  font-size: 12px;
  color: #6b7280;
  margin: 0 8px;
}

.host-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s;
}

.host-item:hover {
  background-color: #f3f4f6;
}

.host-name {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
  flex: 1;
}

.rule-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
}

.rule-item:hover {
  background-color: #f9fafb;
}

.rule-content {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
  font-family: "SF Mono", Monaco, monospace;
}

.rule-ip {
  color: #374151;
  font-weight: 500;
  width: 90px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.rule-domain {
  color: #6b7280;
  width: 90px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: all 0.2s ease;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #3b82f6;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

#groups-list {
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-top: none;
  background-color: #fff;
  margin-bottom: 8px;
  border-radius: 0 0 8px 8px;
}

.group-section {
  padding: 4px 0;
  border-bottom: 1px solid #e5e7eb;
}

.group-section:last-child {
  border-bottom: none;
}

.group-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.group-header:hover {
  background-color: #f5f5f5;
}

.arrow {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid #6b7280;
  margin-right: 8px;
  transition: transform 0.2s;
}

.arrow.expanded {
  transform: rotate(90deg);
}

.group-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.group-content.expanded {
  max-height: 500px;
  overflow-y: auto;
}

.empty-state {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

/* GitHub 链接样式 */
.github-section {
  text-align: center;
  padding-top: 8px;
}

.github-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  color: #24292e;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.github-link:hover {
  background-color: #f6f8fa;
  transform: translateY(-1px);
}

.github-link svg {
  fill: currentColor;
  transition: all 0.2s ease;
}

.github-link:hover svg {
  fill: #0366d6;
}
