:root {
  --hhx-primary: #0a5fd4;
  --hhx-primary-dark: #0847a8;
  --hhx-primary-light: #e8f0fd;
  --hhx-accent: #00c8a0;
  --hhx-text: #1a1a2e;
  --hhx-muted: #667085;
  --hhx-border: #e5eaf1;
  --hhx-surface: #ffffff;
  --hhx-shadow: 0 10px 30px rgba(10, 95, 212, 0.12);
}

body.hhx-site-shell {
  --primary: var(--hhx-primary);
  --primary-dark: var(--hhx-primary-dark);
  --primary-light: var(--hhx-primary-light);
  --accent: var(--hhx-accent);
  color: var(--hhx-text);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.hhx-site-shell *,
body.hhx-site-shell *::before,
body.hhx-site-shell *::after {
  box-sizing: border-box;
}

.hhx-global-header,
.hhx-global-header * {
  box-sizing: border-box;
}

.hhx-global-header {
  position: sticky;
  top: 0;
  z-index: 2147483000;
  width: 100%;
  height: 68px;
  color: var(--hhx-text);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(10, 95, 212, 0.09);
  box-shadow: 0 2px 14px rgba(23, 43, 77, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hhx-global-header.is-scrolled {
  box-shadow: var(--hhx-shadow);
}

.hhx-global-inner {
  width: min(1200px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hhx-global-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--hhx-primary);
  text-decoration: none;
  white-space: nowrap;
}

.hhx-global-brand img {
  display: block;
  width: auto;
  height: 38px;
  object-fit: contain;
}

.hhx-global-brand-copy {
  padding-left: 12px;
  border-left: 1px solid var(--hhx-border);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.hhx-global-links {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hhx-global-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.hhx-global-links a:hover,
.hhx-global-links a:focus-visible {
  color: var(--hhx-primary);
  background: rgba(10, 95, 212, 0.055);
  outline: none;
}

.hhx-global-links a[aria-current="page"] {
  color: var(--hhx-primary);
  background: transparent;
  font-weight: 650;
  box-shadow: none;
}

.hhx-global-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: 2px;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hhx-primary), var(--hhx-accent));
  transform: translateX(50%);
}

.hhx-global-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--hhx-border);
  border-radius: 10px;
  color: var(--hhx-primary);
  background: var(--hhx-surface);
  cursor: pointer;
}

.hhx-global-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hhx-global-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hhx-global-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hhx-global-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

body.hhx-site-shell button,
body.hhx-site-shell a,
body.hhx-site-shell input,
body.hhx-site-shell select,
body.hhx-site-shell textarea {
  font-family: inherit;
}

body.hhx-site-shell :focus-visible {
  outline: 3px solid rgba(10, 95, 212, 0.24);
  outline-offset: 2px;
}

/* The professional-query charts contain fixed-size canvases. Keep their grid
   items shrinkable on narrow screens so the page never drifts horizontally. */
body.hhx-site-shell .charts-grid > .chart-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.hhx-site-shell .chart-card canvas {
  max-width: 100%;
}

@media (max-width: 1120px) {
  .hhx-global-brand-copy { display: none; }
  .hhx-global-links a { padding-inline: 8px; font-size: 13px; }
}

@media (max-width: 900px) {
  .hhx-global-header { height: 62px; }
  .hhx-global-inner { width: min(100% - 24px, 1200px); }
  .hhx-global-brand img { height: 34px; }
  .hhx-global-toggle { display: block; }
  .hhx-global-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--hhx-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 50px rgba(23, 43, 77, 0.18);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }
  .hhx-global-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .hhx-global-links a { justify-content: center; min-height: 42px; font-size: 14px; }
}

@media (max-width: 420px) {
  .hhx-global-links { grid-template-columns: 1fr; max-height: calc(100vh - 86px); overflow: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hhx-global-header *, .hhx-global-header *::before, .hhx-global-header *::after { transition: none !important; }
}

