body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(var(--sys-primary-rgb), 0.08), transparent 24%),
    linear-gradient(180deg, #ffffff, #f5fbff 58%, #e8f4fb 100%);
  color: var(--color-text, var(--sys-text));
}

:root {
  --header-text: #12344d;
  --header-text-strong: #0f2f46;
  --header-text-muted: #5c7489;
}

.header-wrapper {
  background: rgba(255, 255, 255, 0.94);
  color: var(--header-text);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(var(--sys-primary-rgb), 0.08);
  box-shadow: 0 10px 30px rgba(var(--sys-primary-strong-rgb), 0.08);
}

.header-container {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-logo img {
  height: 50px;
  object-fit: contain;
  border-radius: 40px;
  box-shadow: 0 8px 18px rgba(var(--sys-primary-strong-rgb), 0.1);
}

.header-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  font-family: "Roboto", "Segoe UI", sans-serif;
  color: var(--header-text-strong);
}

.header-title {
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1.05;
}

.header-subtitle {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--header-text-muted);
  line-height: 1.1;
}

.header-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(0.22rem, 1vw, 0.55rem);
  margin: 0;
  padding: 0;
}

.header-nav a {
  font-family: var(--bs-body-font-family);
  font-size: 0.82rem;
  color: var(--header-text);
  text-decoration: none;
  font-weight: 400;
  position: relative;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.5rem;
  border-radius: 999px;
}

.header-nav a i {
  font-size: 0.8rem;
}

.header-nav a:hover {
  color: var(--header-text-strong);
  background-color: rgba(var(--sys-primary-rgb), 0.08);
}

.header-nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: linear-gradient(90deg, var(--color-accent, #5ec4ee), var(--color-secondary, #197fb8));
  transition: width 0.3s ease;
}

.header-nav a:hover::after {
  width: 100%;
}

.header-nav a.active::after {
  width: 100%;
}

.header-toggle {
  display: none;
  background: none;
  border: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  background: rgba(var(--sys-primary-rgb), 0.08);
  border: 1px solid rgba(var(--sys-primary-rgb), 0.12);
  color: var(--color-primary, var(--sys-primary-strong));
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 1rem;
  z-index: 1001;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.header-toggle:hover {
  background: rgba(var(--sys-primary-rgb), 0.12);
  border-color: rgba(var(--sys-primary-rgb), 0.2);
}

.header-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--color-primary, var(--sys-primary-strong));
  transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease;
}

.header-toggle.is-open .header-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.header-toggle.is-open .header-toggle-line:nth-child(2) {
  opacity: 0;
}

.header-toggle.is-open .header-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 768px) {
  .header-toggle {
    width: 52px;
    height: 52px;
    right: 0.75rem;
  }

  .header-toggle-line {
    width: 22px;
    height: 2.5px;
    margin: 4.5px auto;
  }

  .header-title {
    font-size: 1.16rem;
  }

  .header-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
  }

  .header-nav {
    position: absolute;
    top: 130%;
    right: 2px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(var(--sys-primary-rgb), 0.08);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(var(--sys-primary-strong-rgb), 0.12);
    width: max-content;
    min-width: 180px;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    padding: 0;
    transition: all 0.3s ease;
  }

  .header-nav ul {
    flex-direction: column;
    padding: 0.9rem;
    gap: 0.6rem;
  }

  .header-nav.show {
    max-height: min(78vh, 560px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .header-toggle {
    display: block;
  }

  .header-nav ul li {
    width: 100%;
  }

  .header-nav ul li a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.2rem;
    border-radius: 8px;
    width: auto;
    position: relative;
  }

  .header-nav ul li a::after {
    left: 0.2rem;
    width: 0;
    bottom: 0;
  }

  .header-nav ul li a:hover::after,
  .header-nav ul li a.active::after {
    width: calc(100% - 0.4rem);
  }
}
