:root { --shared-header-height: 78px; }

.shared-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  color: #201e1d;
  background: rgba(250, 248, 246, .94);
  border-bottom: 2px solid #201e1d;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.shared-sticky-banner {
  position: sticky;
  top: var(--shared-header-height);
  z-index: 900;
}

.shared-header-inner {
  width: 100%;
  max-width: 1240px;
  min-height: 76px;
  margin-inline: auto;
  padding: 14px clamp(20px, 5vw, 48px);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
}

.shared-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  color: #201e1d;
  text-decoration: none;
}

.shared-brand:hover { color: #201e1d; }
.shared-brand > .shared-brand-logo { display: block; width: 48px; height: 48px; object-fit: contain; }
.shared-brand-divider { display: block; width: 2px; height: 30px; background: #dad5d1; }
.shared-brand-name { color: #201e1d; font-size: 16px; font-weight: 800; line-height: 1.2; letter-spacing: .02em; white-space: nowrap; }

.shared-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.shared-nav > .shared-nav-item {
  position: relative;
  box-sizing: border-box;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid transparent;
  color: #201e1d;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.shared-nav > .shared-nav-item:hover {
  color: #1f2a8c;
  background: rgba(31, 42, 140, .06);
}

.shared-nav > .shared-nav-item.is-active,
.shared-nav > .shared-nav-item[aria-current="page"] {
  color: #fff;
  background: #1f2a8c;
  border-color: #1f2a8c;
  font-weight: 600;
}

.shared-course-badge {
  position: absolute;
  top: -8px;
  right: 7px;
  box-sizing: border-box;
  min-width: 33px;
  width: 33px;
  height: 16px;
  min-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: #fff;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .08em;
}

.shared-new-badge { background: #1268ac; }
.shared-hot-badge { background: #d7462f; }

.shared-mobile-menu {
  display: none;
  position: relative;
  margin-left: auto;
  background: transparent;
  border: 0;
}

.shared-mobile-menu > summary {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  list-style: none;
  color: #201e1d;
  background: #fff;
  border: 1.5px solid #201e1d;
  cursor: pointer;
}

.shared-mobile-menu > summary::-webkit-details-marker { display: none; }
.shared-mobile-menu > summary::after { content: none; }
.shared-mobile-menu[open] > summary { color: #fff; background: #1f2a8c; border-color: #1f2a8c; }

.shared-mobile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  padding: 8px;
  background: #fff;
  border: 1.5px solid #201e1d;
  box-shadow: 0 18px 42px rgba(32, 30, 29, .2);
}

.shared-mobile-panel > .shared-mobile-item {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid #e4dfdb;
  color: #201e1d;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.shared-mobile-panel > .shared-mobile-item:last-child { margin-top: 8px; border-bottom: 0; }
.shared-mobile-panel > .shared-mobile-item.is-active,
.shared-mobile-panel > .shared-mobile-item[aria-current="page"] { color: #fff; background: #1f2a8c; }
.shared-mobile-panel .shared-course-badge { position: static; flex: 0 0 33px; }

@media (max-width: 899px) {
  :root { --shared-header-height: 70px; }
  .shared-header-inner { min-height: 68px; padding: 10px 16px; gap: 12px; }
  .shared-brand { gap: 12px; }
  .shared-brand > .shared-brand-logo { width: 36px; height: 36px; }
  .shared-brand-divider { width: 2px; height: 30px; }
  .shared-brand-name { font-size: 15px; }
  .shared-nav { display: none; }
  .shared-mobile-menu { display: block; }
}
