.ime-system-entry {
  position: fixed;
  left: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 2147483000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", sans-serif;
  color: #f8f1e3;
}

div.fixed.top-0.left-0.pointer-events-none[class*="z-[9999]"] {
  position: fixed !important;
  z-index: 2147483647 !important;
  pointer-events: none !important;
}

div.fixed.top-0.left-0.pointer-events-none[class*="z-[9998]"] {
  position: fixed !important;
  z-index: 2147483646 !important;
  pointer-events: none !important;
}

.ime-system-entry summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(212, 168, 155, 0.42);
  border-radius: 999px;
  padding: 10px 15px;
  background: rgba(15, 10, 22, 0.86);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  color: #f8f1e3;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
  backdrop-filter: blur(18px);
}

.ime-system-entry summary::-webkit-details-marker {
  display: none;
}

.ime-system-entry-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 6px;
  min-width: 168px;
  padding: 10px;
  border: 1px solid rgba(212, 168, 155, 0.3);
  border-radius: 16px;
  background: rgba(12, 8, 18, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.ime-system-entry-panel a {
  display: block;
  border-radius: 10px;
  padding: 9px 10px;
  color: rgba(248, 241, 227, 0.86);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0;
}

.ime-system-entry-panel a:hover,
.ime-system-entry-panel a:focus-visible {
  background: rgba(184, 149, 63, 0.18);
  color: #fff7df;
  outline: none;
}

.ime-system-header-link,
.ime-system-mobile-link {
  align-items: center !important;
  background: #1f1b1a !important;
  border: 1px solid rgba(184, 149, 63, 0.55) !important;
  border-radius: 999px !important;
  color: #fff7df !important;
  display: inline-flex !important;
  font-weight: 800 !important;
  justify-content: center !important;
  line-height: 1 !important;
  min-height: 36px !important;
  opacity: 1 !important;
  padding: 0.55rem 0.8rem !important;
  text-decoration: none !important;
  transform: translateY(0) !important;
  white-space: nowrap !important;
}

.ime-system-header-link--admin,
.ime-system-mobile-link--admin {
  background: #b8953f !important;
  border-color: #b8953f !important;
  color: #1f1b1a !important;
}

.ime-system-header-link:hover,
.ime-system-header-link:focus-visible,
.ime-system-mobile-link:hover,
.ime-system-mobile-link:focus-visible {
  box-shadow: 0 10px 24px rgba(31, 27, 26, 0.18) !important;
  filter: brightness(1.04) !important;
  outline: none !important;
}

@media (max-width: 640px) {
  .ime-system-entry {
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    right: auto;
    z-index: 2147482600;
  }

  .ime-system-entry[data-ime-system-entry-hidden] {
    display: none !important;
  }

  .ime-system-entry[data-ime-mobile-public] {
    color: #f8f1e3;
  }

  .ime-system-entry[data-ime-mobile-public] summary {
    display: none;
  }

  .ime-system-entry[data-ime-mobile-public] .ime-system-entry-panel {
    align-items: center;
    background: transparent;
    border: 0;
    bottom: auto;
    box-shadow: none;
    display: flex;
    gap: 8px;
    left: auto;
    min-width: 0;
    padding: 0;
    position: static;
    width: auto;
  }

  .ime-system-entry[data-ime-mobile-public] .ime-system-entry-panel a {
    background: rgba(15, 10, 22, 0.84);
    border: 1px solid rgba(212, 168, 155, 0.34);
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    color: #f8f1e3;
    font-size: 12px;
    line-height: 1;
    padding: 9px 12px;
    white-space: nowrap;
  }
}


.ime-official-language-switch {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 27, 26, 0.14);
  border-radius: 999px;
  color: #1f1b1a !important;
  display: inline-flex;
  gap: 2px;
  margin: 0 0.35rem;
  padding: 3px;
  white-space: nowrap;
}

.ime-official-language-switch a {
  border-radius: 999px;
  color: #1f1b1a !important;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
  text-decoration: none;
}

.ime-official-language-switch a.is-active {
  background: #1f1b1a;
  color: #fff7df !important;
}


.ime-official-header-overlay {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  position: fixed;
  right: clamp(20px, 5vw, 72px);
  top: clamp(64px, 7vw, 78px);
  z-index: 2147483200;
  pointer-events: auto;
}

.ime-official-header-overlay .ime-system-header-link {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18) !important;
}

@media (max-width: 760px) {
  .ime-official-header-overlay {
    gap: 0.35rem;
    left: 12px;
    right: 12px;
    top: 72px;
    justify-content: flex-end;
  }

  .ime-official-header-overlay .ime-system-header-link {
    min-height: 34px !important;
    padding: 0.5rem 0.62rem !important;
  }
}

/* official-header-readable-20260630
   Public official pages place the header over dark WebGL, floral images, and light content.
   Give both the original header and injected controls an adaptive readable surface. */
html[data-ime-header-tone="light"] body header,
html:not([data-ime-header-tone]) body header {
  background: rgba(255, 250, 242, 0.88) !important;
  border-bottom: 1px solid rgba(31, 27, 26, 0.08) !important;
  box-shadow: 0 12px 34px rgba(31, 27, 26, 0.08) !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
}

html[data-ime-header-tone="dark"] body header {
  background: rgba(18, 8, 27, 0.76) !important;
  border-bottom: 1px solid rgba(255, 247, 223, 0.14) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
}

html[data-ime-header-tone="light"] body header :where(a:not(.btn-gold), button:not(.btn-gold)),
html:not([data-ime-header-tone]) body header :where(a:not(.btn-gold), button:not(.btn-gold)) {
  color: #1f1b1a !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-ime-header-tone="dark"] body header :where(a:not(.btn-gold), button:not(.btn-gold)) {
  color: #fff7df !important;
  opacity: 1 !important;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45) !important;
}

body header img {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.14));
}

.ime-official-header-overlay {
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid rgba(31, 27, 26, 0.12);
  border-radius: 999px;
  box-shadow: 0 16px 38px rgba(31, 27, 26, 0.16);
  padding: 5px;
  backdrop-filter: blur(18px) saturate(1.08);
}

html[data-ime-header-tone="light"] .ime-official-header-overlay {
  background: rgba(255, 250, 242, 0.9);
  border-color: rgba(31, 27, 26, 0.12);
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay {
  background: rgba(18, 8, 27, 0.78);
  border-color: rgba(255, 247, 223, 0.18);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);
}

html[data-ime-header-tone="dark"] .ime-official-language-switch {
  background: rgba(255, 247, 223, 0.12);
  border-color: rgba(255, 247, 223, 0.22);
}

html[data-ime-header-tone="dark"] .ime-official-language-switch a {
  color: #fff7df !important;
}

html[data-ime-header-tone="dark"] .ime-official-language-switch a.is-active {
  background: #fff7df;
  color: #1f1b1a !important;
}
/* official-header-readable-hardening-20260630
   Final guard for official header readability: set inherited color on the
   header and quick controls, then restore active pills explicitly. */
html[data-ime-header-tone="light"] body header,
html:not([data-ime-header-tone]) body header {
  color: #1f1b1a !important;
}

html[data-ime-header-tone="dark"] body header {
  color: #fff7df !important;
}

html[data-ime-header-tone="light"] body header :where(a, button, span, p, div):not(.btn-gold):not(.ime-official-language-switch),
html:not([data-ime-header-tone]) body header :where(a, button, span, p, div):not(.btn-gold):not(.ime-official-language-switch) {
  color: #1f1b1a !important;
  opacity: 1 !important;
}

html[data-ime-header-tone="dark"] body header :where(a, button, span, p, div):not(.btn-gold):not(.ime-official-language-switch) {
  color: #fff7df !important;
  opacity: 1 !important;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.46) !important;
}

html[data-ime-header-tone="light"] .ime-official-header-overlay,
html:not([data-ime-header-tone]) .ime-official-header-overlay {
  color: #1f1b1a !important;
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay {
  color: #fff7df !important;
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay :where(a, button, span) {
  color: #fff7df !important;
  opacity: 1 !important;
}

html[data-ime-header-tone="light"] .ime-official-header-overlay :where(a, button, span),
html:not([data-ime-header-tone]) .ime-official-header-overlay :where(a, button, span) {
  color: #1f1b1a !important;
  opacity: 1 !important;
}

html[data-ime-header-tone="light"] .ime-official-header-overlay .ime-system-header-link,
html:not([data-ime-header-tone]) .ime-official-header-overlay .ime-system-header-link,
html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-system-header-link {
  color: #fff7df !important;
}

html[data-ime-header-tone="light"] .ime-official-header-overlay .ime-system-header-link--admin,
html:not([data-ime-header-tone]) .ime-official-header-overlay .ime-system-header-link--admin,
html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-system-header-link--admin,
html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-official-language-switch a.is-active {
  color: #1f1b1a !important;
}

/* official-language-switch-tone-adaptive-20260701
   Keep language toggle contrast after broad header tone guards recolor links. */
.ime-official-header-overlay .ime-official-language-switch {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

html[data-ime-header-tone="light"] .ime-official-header-overlay .ime-official-language-switch,
html:not([data-ime-header-tone]) .ime-official-header-overlay .ime-official-language-switch {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(31, 27, 26, 0.14);
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-official-language-switch {
  background: rgba(255, 247, 223, 0.14);
  border-color: rgba(255, 247, 223, 0.26);
}

html[data-ime-header-tone="light"] .ime-official-header-overlay .ime-official-language-switch a,
html:not([data-ime-header-tone]) .ime-official-header-overlay .ime-official-language-switch a {
  color: #1f1b1a !important;
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-official-language-switch a {
  color: #fff7df !important;
}

html[data-ime-header-tone="light"] .ime-official-header-overlay .ime-official-language-switch a.is-active,
html:not([data-ime-header-tone]) .ime-official-header-overlay .ime-official-language-switch a.is-active {
  background: #1f1b1a;
  color: #fff7df !important;
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-official-language-switch a.is-active {
  background: #fff7df;
  color: #1f1b1a !important;
}

/* official-mobile-header-click-shield-fix-20260701
   Mobile quick controls must not become a full-width transparent click shield. */
@media (max-width: 760px) {
  .ime-official-header-overlay {
    left: auto;
    right: calc(max(12px, env(safe-area-inset-right)) + 48px);
    width: auto;
    top: max(14px, env(safe-area-inset-top));
    max-width: calc(100vw - 96px);
    pointer-events: none;
  }

  .ime-official-header-overlay > * {
    pointer-events: auto;
  }
}


/* official-header-controls-inline-20260701
   Keep admin shortcuts inside the original official nav. The floating overlay is
   language-only on mobile so it cannot cover marketing hero copy. */
body header nav:has([data-ime-system-header-link]) {
  gap: clamp(0.5rem, 1.1vw, 1.35rem) !important;
  min-width: 0 !important;
}

body header nav:has([data-ime-system-header-link]) .ime-system-header-link {
  font-size: clamp(0.72rem, 0.78vw, 0.82rem) !important;
  min-height: 32px !important;
  padding: 0.48rem 0.68rem !important;
}

body header nav:has([data-ime-system-header-link]) .ime-official-language-switch {
  flex: 0 0 auto !important;
  margin: 0 0 0 0.1rem !important;
}

body header nav:has([data-ime-system-header-link]) .btn-gold {
  flex: 0 0 auto !important;
}

@media (max-width: 1180px) and (min-width: 768px) {
  body header nav:has([data-ime-system-header-link]) {
    gap: 0.5rem !important;
  }

  body header nav:has([data-ime-system-header-link]) .ime-system-header-link {
    font-size: 0.72rem !important;
    min-height: 30px !important;
    padding: 0.42rem 0.56rem !important;
  }

  body header nav:has([data-ime-system-header-link]) .ime-official-language-switch a {
    font-size: 0.72rem !important;
    padding: 6px 8px !important;
  }
}

@media (min-width: 768px) {
  .ime-official-header-overlay {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .ime-official-header-overlay .ime-system-header-link {
    display: none !important;
  }

  .ime-official-header-overlay .ime-official-language-switch {
    margin: 0 !important;
  }
}
/* official-language-switch-nav-active-contrast-20260702
   Desktop nav language pills live inside header nav, so they need a final rule after broad header recoloring. */
body header nav:has([data-ime-system-header-link]) .ime-official-language-switch a.is-active,
body header nav .ime-official-language-switch--nav a.is-active {
  background: #1f1b1a !important;
  color: #fff7df !important;
}

html[data-ime-header-tone="dark"] body header nav:has([data-ime-system-header-link]) .ime-official-language-switch a.is-active,
html[data-ime-header-tone="dark"] body header nav .ime-official-language-switch--nav a.is-active {
  background: #fff7df !important;
  color: #1f1b1a !important;
}

/* header-soft-controls-20260702
   Keep admin/language controls readable without the heavy black filled pills. */
.ime-official-header-overlay .ime-system-header-link {
  background: rgba(255, 247, 235, 0.88) !important;
  border-color: rgba(184, 149, 63, 0.42) !important;
  color: #21191d !important;
  text-shadow: none !important;
}

.ime-official-header-overlay .ime-system-header-link--admin {
  background: linear-gradient(135deg, #c9a23c, #a77f27) !important;
  border-color: rgba(255, 247, 223, 0.5) !important;
  color: #1f1b1a !important;
}

.ime-official-header-overlay .ime-official-language-switch {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(31, 27, 26, 0.16) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
  color: #1f1b1a !important;
}

.ime-official-header-overlay .ime-official-language-switch a {
  background: transparent !important;
  color: #1f1b1a !important;
}

.ime-official-header-overlay .ime-official-language-switch a.is-active,
html[data-ime-header-tone="light"] .ime-official-header-overlay .ime-official-language-switch a.is-active,
html:not([data-ime-header-tone]) .ime-official-header-overlay .ime-official-language-switch a.is-active,
html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-official-language-switch a.is-active {
  background: rgba(184, 149, 63, 0.24) !important;
  box-shadow: inset 0 0 0 1px rgba(184, 149, 63, 0.38) !important;
  color: #1f1b1a !important;
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-system-header-link:not(.ime-system-header-link--admin) {
  background: rgba(255, 247, 235, 0.18) !important;
  border-color: rgba(255, 247, 223, 0.36) !important;
  color: #fff7df !important;
}

html[data-ime-header-tone="dark"] .ime-official-header-overlay .ime-official-language-switch {
  background: rgba(255, 247, 235, 0.86) !important;
}

@media (max-width: 760px) {
  .ime-official-header-overlay {
    align-items: center !important;
    gap: 6px !important;
    max-width: calc(100vw - 92px) !important;
  }

  .ime-official-header-overlay .ime-system-header-link,
  .ime-official-header-overlay .ime-official-language-switch a {
    font-size: 12px !important;
  }
}
/* official-language-switch-soft-final-20260702
   Final override for public-page language pills: avoid heavy black active states on both light and dark headers. */
.ime-official-language-switch,
body header nav .ime-official-language-switch,
body header nav:has([data-ime-system-header-link]) .ime-official-language-switch {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(31, 27, 26, 0.16) !important;
  color: #1f1b1a !important;
}

.ime-official-language-switch a,
body header nav .ime-official-language-switch a,
body header nav:has([data-ime-system-header-link]) .ime-official-language-switch a {
  background: transparent !important;
  color: #1f1b1a !important;
}

.ime-official-language-switch a.is-active,
body header nav .ime-official-language-switch a.is-active,
body header nav:has([data-ime-system-header-link]) .ime-official-language-switch a.is-active,
body header nav .ime-official-language-switch--nav a.is-active,
html[data-ime-header-tone="dark"] body header nav .ime-official-language-switch--nav a.is-active,
html[data-ime-header-tone="dark"] body header nav:has([data-ime-system-header-link]) .ime-official-language-switch a.is-active {
  background: rgba(184, 149, 63, 0.24) !important;
  box-shadow: inset 0 0 0 1px rgba(184, 149, 63, 0.38) !important;
  color: #1f1b1a !important;
}
/* official-system-header-link-soft-final-20260702
   Desktop system shortcuts are inserted into the original nav, not the floating overlay.
   Keep them readable after broad header tone recoloring so org does not become a black pill. */
body header nav:has([data-ime-system-header-link]) .ime-system-header-link:not(.ime-system-header-link--admin),
body header nav .ime-system-header-link--org {
  background: rgba(255, 247, 235, 0.86) !important;
  border-color: rgba(184, 149, 63, 0.46) !important;
  box-shadow: 0 10px 24px rgba(31, 27, 26, 0.12) !important;
  color: #21191d !important;
  text-shadow: none !important;
}

body header nav:has([data-ime-system-header-link]) .ime-system-header-link--admin,
body header nav .ime-system-header-link--admin {
  background: linear-gradient(135deg, #c9a23c, #a77f27) !important;
  border-color: rgba(184, 149, 63, 0.64) !important;
  box-shadow: 0 10px 24px rgba(31, 27, 26, 0.14) !important;
  color: #1f1b1a !important;
  text-shadow: none !important;
}