document.addEventListener('DOMContentLoaded', () => {
  document.getElementById('openPanelBtn').addEventListener('click', openPanel);
  document.getElementById('openSettingsBtn').addEventListener('click', openSettings);
});

async function openPanel() {
  const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
  await chrome.sidePanel.open({ tabId: tab.id });
  window.close();
}

function openSettings() {
  // TODO: 设置页
}
