:root {
  --header-height: 60px;
  --drawer-width: 280px;
}

#viewer-section {
  width: 100%;
}

/* 導覽列 */
#viewer-section header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);

  background: var(--bg-color);
  color: var(--text-color);
  box-shadow: 0 2px 5px var(--shadow-color);

  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
#viewer-section .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
  padding: 0 20px;
  width: 100%;
}

#viewer-section .header-group {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: .5em;
}

#viewer-section .toggle-btn {
  cursor: pointer;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
#viewer-section .toggle-btn:hover,
#viewer-section .toggle-btn.active { background: var(--header-btn-active-color); }

#viewer-section #site-title {
  margin-left: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

/* 側邊抽屜選單 */
#viewer-section #nav-menu {
  position: fixed;
  top: var(--header-height);
  left: calc(-1 * var(--drawer-width));
  width: var(--drawer-width);
  height: calc(100% - var(--header-height));
  border-right: 1px solid var(--shadow-color);
  border-left: 1px solid var(--shadow-color);

  background: var(--bg-color);
  color: var(--text-minor-color);
  transition: transform 0.3s ease;
  z-index: 999;
  overflow-y: auto;
}
#viewer-section #nav-menu.open {
  transform: translateX(var(--drawer-width));
}

#viewer-menu-title {
  padding: 20px;
  font-weight: bold;
  color: var(--text-color);
  font-size: 0.9rem;
}

.menu-item {
  padding: 15px 25px;
  cursor: pointer;
  border-bottom: 1px solid var(--shadow-color);
  transition: background 0.2s;
}
.menu-item:hover { background: var(--shadow-color); color: var(--primary-color); }


/* 主內容區塊 (Iframe) */
#viewer-section main {
  padding-top: var(--header-height);
  height: 100vh;
  box-sizing: border-box;

  display: flex;
  justify-content: center;
}
#viewer-section main iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* 遮罩層 (點擊選單外可關閉) */
#overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  display: none;
  z-index: 998;
}


/* 寬版模式 */
.header-container,
iframe {
  max-width: 800px;
}

.wide-mode .header-container,
.wide-mode iframe {
  max-width: none;
}