/* MOOSSin one-row header (owner decision 2026-10-05, plan A): the brand, the five sections with the
 * current section's own menu behind a chevron, and a few tools, in one row; one "選單" drawer below
 * 960px. Shared verbatim by all five sections; every rule is scoped to .mooss-bar and resets what a
 * section stylesheet could leak in. Colours are the portal's palette (ink 14.6:1, muted 7.7:1 and
 * moss 6.1:1 on the bar). Change it in every section at once, never in one. */
.mooss-bar {
  position: relative;
  z-index: 40;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #dfe5dc;
  background: #fbfcfa;
  color: #1c221d;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-align: left;
}

.mooss-bar *,
.mooss-bar *::before,
.mooss-bar *::after {
  box-sizing: border-box;
}

.mooss-bar a {
  color: inherit;
  text-decoration: none;
}

.mooss-bar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mooss-bar li {
  margin: 0;
  padding: 0;
}

.mooss-bar summary {
  list-style: none;
  cursor: pointer;
}

.mooss-bar summary::-webkit-details-marker {
  display: none;
}

.mooss-bar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1180px;
  min-height: 56px;
  margin: 0 auto;
  padding: 0 20px;
}

.mooss-bar__brand {
  flex: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mooss-bar__here {
  display: none;
}

.mooss-bar__sections {
  flex: 1 1 auto;
  min-width: 0;
}

.mooss-bar__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mooss-bar__list > li {
  position: relative;
  display: flex;
  align-items: center;
}

.mooss-bar__list a,
.mooss-bar__tools a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 6px;
  color: #4a544b;
  white-space: nowrap;
}

.mooss-bar__list a:hover,
.mooss-bar__tools a:hover {
  background: #f1f4ef;
  color: #1c221d;
}

.mooss-bar__list > li > a[aria-current="page"] {
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 -2px 0 #2f6b3f;
  color: #1c221d;
  font-weight: 700;
}

.mooss-bar__more > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 40px;
  margin-left: -4px;
  border-radius: 6px;
  color: #4a544b;
}

.mooss-bar__more > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.mooss-bar__more[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.mooss-bar__more > summary:hover {
  background: #f1f4ef;
  color: #1c221d;
}

.mooss-bar__sub {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  padding: 6px;
  border: 1px solid #dfe5dc;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(28, 34, 29, 0.12);
}

.mooss-bar__sub a {
  display: flex;
  width: 100%;
  border-radius: 6px;
  color: #1c221d;
}

.mooss-bar__tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.mooss-bar__drawer {
  display: none;
}

.mooss-bar a:focus-visible,
.mooss-bar summary:focus-visible {
  outline: 2px solid #2f6b3f;
  outline-offset: -2px;
}

@media (max-width: 959px) {
  .mooss-bar__sections,
  .mooss-bar__tools {
    display: none;
  }

  .mooss-bar__inner {
    gap: 8px;
    padding: 0 16px;
  }

  .mooss-bar__here {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #4a544b;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mooss-bar__drawer {
    display: block;
    flex: none;
    margin-left: auto;
  }

  .mooss-bar__drawer > summary {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #c9d2c5;
    border-radius: 8px;
    color: #1c221d;
  }

  .mooss-bar__drawer[open] > summary {
    background: #f1f4ef;
  }

  .mooss-bar__panel {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 8px 16px 16px;
    border-bottom: 1px solid #dfe5dc;
    background: #fbfcfa;
    box-shadow: 0 12px 24px rgba(28, 34, 29, 0.1);
  }

  .mooss-bar__panel a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 6px;
    color: #1c221d;
  }

  .mooss-bar__panel a:hover {
    background: #f1f4ef;
  }

  .mooss-bar__panel > ul > li > a[aria-current="page"] {
    box-shadow: inset 3px 0 0 #2f6b3f;
    font-weight: 700;
  }

  .mooss-bar__panel .mooss-bar__sub-m a {
    padding-left: 26px;
    color: #4a544b;
  }

  .mooss-bar__panel-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dfe5dc;
  }
}
