/* Top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: 2.25rem;
  background: var(--ui-bg);
  border-bottom: 1px solid var(--ui-border);
}

.topbar-brand-banner {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  display: block;
  width: var(--sidebar-width);
  overflow: hidden;
  background: var(--ui-bg);
}

.topbar-brand-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  height: 100%;
  padding: 0 0.75rem;
  margin-left: var(--sidebar-width);
  position: relative;
  z-index: 2;
}

.topbar-nav {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 0.25rem;
  min-width: 0;
}

.topbar-nav-menu {
  position: relative;
  align-self: center;
}

.topbar-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--ui-muted);
  cursor: pointer;
  font-family: var(--ui-text-font);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.topbar-nav-link::-webkit-details-marker {
  display: none;
}

.topbar-nav-link:hover,
.topbar-nav-link:focus-visible,
.topbar-nav-link.is-active,
.topbar-nav-menu[open] > .topbar-nav-link {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface);
  color: var(--ui-text);
}

.topbar-nav-link:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}

.topbar-nav-menu[open] > .topbar-nav-link .utility-chevron {
  color: var(--ui-accent-hover);
  transform: rotate(180deg);
}

.topbar-nav-children {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 100;
  display: flex;
  min-width: 13rem;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-strong);
}

.topbar-nav-child {
  display: block;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-muted);
  font-family: var(--ui-text-font);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.topbar-nav-child:hover,
.topbar-nav-child:focus-visible,
.topbar-nav-child.is-active {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  color: var(--ui-text);
}

.topbar-nav-child:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.topbar-inner .utility-button {
  min-height: 1.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
}

/* Keep the language menu and authentication actions aligned with topbar menus. */
.topbar-actions .topbar-language-button,
.topbar-actions > form .utility-button--danger,
.topbar-actions > a.utility-button[href*="/auth/login"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border-radius: var(--ui-radius);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.topbar-actions .topbar-language-button {
  gap: 0.35rem;
  border-color: transparent;
  background: transparent;
  color: var(--ui-muted);
  cursor: pointer;
  font-family: var(--ui-text-font);
  text-decoration: none;
}

.topbar-actions .topbar-language-button::-webkit-details-marker {
  display: none;
}

.topbar-actions .topbar-language-button::marker {
  content: "";
}

.topbar-actions .topbar-language-button:hover,
.topbar-actions .utility-menu[open] .topbar-language-button,
.topbar-actions .topbar-language-button:focus-visible {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface);
  color: var(--ui-text);
}

.topbar-actions .topbar-language-button:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}

.topbar-actions .topbar-language-button .utility-chevron {
  transition: color 140ms ease, transform 140ms ease;
}

.topbar-actions .utility-menu[open] .topbar-language-button .utility-chevron {
  color: var(--ui-accent-hover);
  transform: rotate(180deg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  position: relative;
  min-height: 100%;
  background: var(--ui-bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei UI", "PingFang TC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.layout-main :where(h1, h2, h3) {
  text-wrap: balance;
}

.layout-main :where(p, li, dd) {
  text-wrap: pretty;
}

body::selection {
  background: rgba(94, 106, 210, 0.24);
  color: #f8fafc;
}


.background-effect canvas {
  position: relative !important;
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 1;
}

.layout-shell,

.public-kicker {
  color: var(--ui-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.access-gate-hero {
  min-height: min(36rem, calc(100vh - 4rem));
  display: grid;
  align-items: center;
  padding-inline: var(--page-padding-inline);
  padding-block: clamp(3rem, 8vw, 6rem);
  border-bottom: 1px solid var(--ui-border);
}

/* Let the home hero use the full main surface while keeping its content inset. */
.layout-main:has(.access-gate-hero) {
  padding-inline: 0;
}

/* Downloads should follow the available viewport instead of the shared 1280px cap. */
.layout-main:has(.software-downloads-page) {
  width: 100%;
  max-width: none;
}

.access-gate-hero-inner {
  display: grid;
  width: 100%;
  margin-inline: auto;
  gap: clamp(2rem, 6vw, 5rem);
}

.access-gate-copy {
  max-width: 48rem;
}

.access-gate-title {
  margin: 1rem 0 0;
  color: #ffffff;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.access-gate-summary {
  max-width: 36rem;
  margin: 1.25rem 0 0;
  color: var(--ui-muted);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.7;
}

.access-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.access-gate-button {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--ui-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  line-height: 1;
}

.access-gate-button:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ui-border-hover);
  color: var(--ui-text);
}

.access-gate-button--primary {
  background: var(--ui-accent);
  color: #ffffff;
  border-color: var(--ui-accent);
  font-weight: 600;
}

.access-gate-button--primary:hover {
  background: var(--ui-accent-hover);
  border-color: var(--ui-accent-hover);
  color: #ffffff;
}

.product-screenshot-card {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-xl);
  background: var(--ui-bg-soft);
  padding: 1.5rem;
}

.access-gate-product-preview {
  min-width: 0;
}

.product-preview-toolbar,
.product-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-preview-toolbar {
  margin-bottom: 1rem;
  color: var(--ui-subtle);
  font-size: 0.75rem;
}

.product-preview-brand {
  color: var(--ui-text);
  font-weight: 600;
}

.product-preview-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.product-preview-status-dot,
.product-preview-icon {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  border-radius: 9999px;
}

.product-preview-status-dot,
.product-preview-icon--success {
  background: var(--ui-success);
}

.product-preview-icon--warning {
  background: var(--ui-warning);
}

.product-preview-icon--info {
  background: var(--ui-info);
}

.product-preview-window {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-bg);
}

.product-preview-sidebar {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.75rem;
  border-right: 1px solid var(--ui-border);
  padding: 1rem 0.7rem;
}

.product-preview-sidebar span {
  width: 1rem;
  height: 0.25rem;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-border-strong);
}

.product-preview-sidebar span.is-active {
  background: var(--ui-accent);
}

.product-preview-content {
  min-width: 0;
  padding: 1rem;
}

.product-preview-heading {
  color: var(--ui-subtle);
  font-size: 0.7rem;
}

.product-preview-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.product-preview-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  padding: 0.75rem;
}

.product-preview-icon {
  margin-top: 0.35rem;
}

.product-preview-list strong,
.product-preview-list small {
  display: block;
}

.product-preview-list strong {
  color: var(--ui-text);
  font-size: 0.78rem;
}

.product-preview-list small {
  overflow: hidden;
  margin-top: 0.2rem;
  color: var(--ui-subtle);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-gate-index {
  border-top: 1px solid var(--ui-border);
  padding-top: 1rem;
}

.access-gate-index-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ui-subtle);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.access-gate-index ol {
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.access-gate-index li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.35rem 1rem;
  border-top: 1px solid var(--ui-border);
  padding: 1rem 0;
}

.access-gate-index li > span {
  grid-row: span 2;
  color: var(--ui-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.access-gate-index strong {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
}

.access-gate-index small {
  color: var(--ui-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.access-gate-section {
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--ui-border);
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.access-gate-section-header {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.access-gate-section-header h2 {
  color: #ffffff;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.access-gate-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.access-gate-section-grid article {
  display: grid;
  gap: 0.5rem;
  border-radius: var(--ui-radius-lg);
  padding: 1.5rem;
}

.access-gate-section-grid span {
  color: var(--ui-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.access-gate-section-grid h3 {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
}

.access-gate-section-grid p {
  max-width: 36rem;
  color: var(--ui-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 1023.98px) {
  .access-gate-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .access-gate-section-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.access-gate-action-grid {
  display: grid;
  gap: 0.75rem;
}

.access-gate-action-grid a {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--ui-border);
  background: var(--ui-bg-soft);
  color: #ffffff;
  padding: 1rem;
  text-decoration: none;
  border-radius: var(--ui-radius);
  transition: border-color 120ms ease, background 120ms ease;
}

.access-gate-action-grid a:hover {
  border-color: var(--ui-border-hover);
  background: var(--ui-surface);
}

.access-gate-action-grid small {
  color: var(--ui-muted);
  line-height: 1.5;
}
.sidebar {
  position: fixed;
  top: 2.25rem;
  bottom: 0;
  left: 0;
  z-index: 70;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--ui-bg-soft);
  border-right: 1px solid var(--ui-border-hover);
}

.layout-body {
  margin-left: var(--sidebar-width);
  padding-top: 2.25rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}


.sidebar-inner {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  min-height: 4rem;
  border-bottom: 1px solid var(--ui-border);
}




.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem;
  scrollbar-color: #334155 #0f172a;
}



.sidebar-parent.is-active,
.sidebar-parent[aria-expanded="true"] {
  border-color: var(--ui-border-bright);
  background: var(--ui-accent-soft);
  box-shadow: none;
  border-left: 2px solid var(--ui-accent);
}




.sidebar-parent[aria-expanded="true"] .sidebar-parent-chevron {
  transform: rotate(180deg);
}



.sidebar-child {
  border: 1px solid transparent;
  border-radius: 0.28rem;
  color: var(--ui-muted);
  padding: 0.42rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.sidebar-child:hover,
.sidebar-child.is-active {
  border-color: rgba(94, 106, 210, 0.18);
  background: var(--ui-surface);
  color: #ffffff;
}

.sidebar-child.is-active {
  color: var(--ui-accent-hover);
  border-left-color: var(--ui-accent);
}

.layout-footer {
  border-top: 1px solid var(--ui-border);
  color: var(--ui-subtle);
}

.layout-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.footer-links a {
  color: var(--ui-subtle);
  text-decoration: none;
  transition: color 120ms ease;
}

.footer-links a:hover {
  color: var(--ui-accent-hover);
}


.layout-shell.is-sidebar-collapsed .sidebar-parent {
  grid-template-columns: 2rem;
  justify-content: center;
  padding-inline: 0.45rem;
}

.layout-shell.is-sidebar-collapsed .sidebar-inner {
  padding-inline: 0.55rem;
}

.layout-shell.is-sidebar-collapsed .sidebar-collapse-icon {
  transform: rotate(180deg);
}


/* Sidebar brand (inside sidebar-header) */
.sidebar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sidebar-brand .brand-link {
  border-right: 0;
  padding-right: 0;
}

/* Sidebar nav link for <summary> inside <details> */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.28rem;
  background: transparent;
  color: var(--ui-muted);
  cursor: pointer;
  font-family: var(--ui-text-font);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
  white-space: nowrap;
  list-style: none;
}

.sidebar-nav-link::-webkit-details-marker {
  display: none;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.is-active,
.sidebar-nav-menu[open] > .sidebar-nav-link {
  color: #ffffff;
}

.sidebar-nav-link.is-active {
  background: rgba(94, 106, 210, 0.1);
  color: var(--ui-accent-hover);
}

.sidebar-nav-menu summary {
  list-style: none;
  cursor: pointer;
}

/* Inline children replacing absolute popover */
.sidebar-nav-children {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.2rem 0 0.2rem 0.65rem;
  position: static;
  box-shadow: none;
  background: transparent;
  border: none;
  border-radius: 0;
  width: auto;
  min-width: auto;
  max-width: none;
  transform: none;
  margin: 0;
}

.sidebar-nav-children::before {
  display: none;
}

.sidebar-nav-child {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.28rem;
  color: var(--ui-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.sidebar-nav-child:hover,
.sidebar-nav-child.is-active {
  background: var(--ui-accent-soft);
  color: #ffffff;
}

.sidebar-nav-child.is-active {
  color: var(--ui-accent-hover);
  border-left-color: var(--ui-accent);
}

/* Sidebar bottom actions */
.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem;
  border-top: 1px solid var(--ui-border);
  flex-wrap: wrap;
}

.sidebar-actions .utility-button,
