/* Shared product and page navigation for all Doukou pages. */
:root {
  --doukou-nav-accent: #6558ff;
  --doukou-header-height: 121px;
}

html {
  scroll-padding-top: calc(var(--doukou-header-height) + 16px);
}

.global-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: #536078;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #e9edf5;
  box-shadow: 0 4px 18px rgba(28, 43, 78, .035);
  backdrop-filter: blur(14px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

.global-site-header *,
.global-site-header *::before,
.global-site-header *::after {
  box-sizing: border-box;
}

.global-primary-row {
  width: min(1440px, calc(100% - 64px));
  min-height: 76px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 190px;
  align-items: center;
  gap: 28px;
}

.global-brand {
  display: flex;
  align-items: center;
  width: 176px;
  flex: 0 0 auto;
}

.global-brand img {
  display: block;
  width: 176px;
  height: 48px;
  max-width: none;
  object-fit: contain;
}

.global-primary-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(18px, 2vw, 32px);
  height: 76px;
  min-width: 0;
}

.global-primary-nav a {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  color: #536078;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}

.global-primary-nav a:hover,
.global-primary-nav a.is-current {
  color: var(--doukou-nav-accent);
}

.global-primary-nav a.is-current {
  font-weight: 600;
}

.global-primary-nav a.is-current::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--doukou-nav-accent);
  transform: translateX(-50%);
}

.global-secondary-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(22px, 3vw, 42px);
  height: 44px;
  padding-inline: 24px;
  border-top: 1px solid #f1f3f8;
  background: #fcfcff;
}

.global-secondary-nav a {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  color: #71809b;
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}

.global-secondary-nav a:hover,
.global-secondary-nav a.is-active {
  color: var(--doukou-nav-accent);
}

.global-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  white-space: nowrap;
}

.global-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  padding: 7px 17px;
  border: 1px solid #dcd8ff;
  border-radius: 20px;
  color: var(--doukou-nav-accent);
  background: #fff;
  font: 500 12px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease;
}

.global-action:hover {
  background: #f4f2ff;
}

.global-action--primary {
  border-color: var(--doukou-nav-accent);
  color: #fff;
  background: var(--doukou-nav-accent);
}

.global-action--primary:hover {
  background: #5548ed;
}

.global-site-header a:focus-visible,
.global-site-header button:focus-visible {
  outline: 2px solid var(--doukou-nav-accent);
  outline-offset: -3px;
}

@media (max-width: 1280px) {
  :root { --doukou-header-height: 145px; }

  .global-primary-row {
    width: calc(100% - 40px);
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 0;
    padding-top: 8px;
  }

  .global-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .global-primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 44px;
    gap: clamp(36px, 4.4vw, 48px);
  }

  .global-primary-nav a { font-size: 14px; }
  .global-primary-nav a.is-current::after { bottom: 3px; }
  .global-secondary-nav { gap: 28px; }
}

@media (max-width: 600px) {
  :root { --doukou-header-height: 135px; }

  .global-primary-row {
    width: calc(100% - 32px);
    grid-template-columns: 146px minmax(0, 1fr);
    padding-top: 7px;
  }

  .global-brand { width: 146px; }
  .global-brand img { width: 146px; height: 40px; }
  .global-actions { gap: 6px; }
  .global-action { min-height: 32px; padding: 6px 11px; font-size: 11px; }

  .global-primary-nav,
  .global-secondary-nav {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    justify-content: flex-start;
    scroll-padding-inline: 16px;
  }

  .global-primary-nav::-webkit-scrollbar,
  .global-secondary-nav::-webkit-scrollbar { display: none; }
  .global-primary-nav { height: 45px; gap: 26px; }
  .global-primary-nav a { font-size: 13px; }
  .global-secondary-nav { height: 42px; gap: 25px; padding-inline: 16px; }
  .global-secondary-nav a { font-size: 12px; }
}

@media (max-width: 360px) {
  .global-primary-row { grid-template-columns: 126px minmax(0, 1fr); }
  .global-brand { width: 126px; }
  .global-brand img { width: 126px; }
  .global-action { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .global-site-header a,
  .global-site-header button { transition: none; }
}
