/* idcub · 全站页头、页脚品牌、搜索、菜单、抽屉；旧基础定义已归入本文件。
   组件与依赖说明：../docs/CSS-ARCHITECTURE.md。 */

.nv-header {
  top: 0;
  z-index: var(--nv-z-header);
  background-color: var(--nv-glass);
  backdrop-filter: var(--nv-blur);
  -webkit-backdrop-filter: var(--nv-blur);
  border-bottom: 1px solid var(--nv-border-soft);
}

.nv-header::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: var(--nv-glass-border);
  pointer-events: none;
}

.nv-header__inner {
  display: flex;
  align-items: center;
  gap: var(--nv-space-4);
  height: var(--nv-header-h);
}

.nv-brand {
  display: flex;
  align-items: center;
  gap: var(--nv-space-3);
  flex-shrink: 0;
  color: var(--nv-text-primary);
}

.nv-brand:hover {
  color: var(--nv-text-primary);
}

.nv-brand__mark {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  border-radius: var(--nv-radius-sm);
  background-image: var(--nv-gradient);
  box-shadow: var(--nv-shadow-brand);
  flex-shrink: 0;
  overflow: hidden;
}

.nv-brand__mark > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.nv-brand__mark:has(> img) {
  background-image: none;
  box-shadow: none;
}

.nv-brand__mark.is-fallback {
  background-image: var(--nv-gradient);
  box-shadow: var(--nv-shadow-brand);
}

.nv-brand__name {
  font-size: var(--nv-fs-body);
  font-weight: var(--nv-weight-bold);
  letter-spacing: var(--nv-ls-heading);
  -webkit-text-stroke: .4px currentColor;
}

.nv-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex: 0 0 36px;
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius-btn);
  background-color: var(--nv-soft);
  color: var(--nv-text-secondary);
  transition: background-color var(--nv-dur-fast) var(--nv-ease-out),
    border-color var(--nv-dur-fast) var(--nv-ease-out),
    color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-burger:hover {
  background-color: var(--nv-brand-soft);
  border-color: var(--nv-border-brand);
  color: var(--nv-brand-ink);
}

.nv-burger:active {
  transform: translateY(1px);
}

.nv-burger .material-icons-outlined {
  font-size: 20px;
}

@media (min-width: 900px) {
  .nv-burger {
    display: none;
  }
}

.nv-search {
  display: flex;
  align-items: center;
  gap: var(--nv-space-2);
  min-width: 0;
  height: 42px;
  padding: 0 var(--nv-space-1) 0 var(--nv-space-3);
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius-pill);
  background-color: var(--nv-soft);
  transition: border-color var(--nv-dur-fast) var(--nv-ease-out),
    background-color var(--nv-dur-fast) var(--nv-ease-out),
    box-shadow var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-search:focus-within {
  border-color: var(--nv-border-brand);
  background-color: var(--nv-elevated);
  box-shadow: var(--nv-ring);
}

.nv-search__ico {
  font-size: 18px;
  flex: 0 0 18px;
  color: var(--nv-text-faint);
  transition: color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-search:focus-within .nv-search__ico {
  color: var(--nv-brand);
}

.nv-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: var(--nv-fs-caption);
  color: var(--nv-text-primary);
}

.nv-search__input::placeholder {
  color: var(--nv-text-muted);
}

.nv-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.nv-search__btn {
  flex: 0 0 auto;
  height: 28px;
  padding-inline: var(--nv-space-3);
  border-radius: var(--nv-radius-pill);
  background-image: var(--nv-gradient);
  color: #fff;
  font-size: var(--nv-fs-micro);
  font-weight: var(--nv-weight-medium);
  white-space: nowrap;
  transition: opacity var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-search__btn:hover {
  opacity: .9;
}

.nv-search--drawer {
  display: flex;
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  height: 42px;
  max-width: none;
  margin-bottom: var(--nv-space-4);
  background-color: var(--nv-soft);
}

.nv-drawer {
  position: fixed;
  inset-block: 0;
  right: 0;
  width: min(320px, 84vw);
  z-index: var(--nv-z-drawer);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--nv-space-5);
  background-color: var(--nv-glass-strong);
  backdrop-filter: var(--nv-blur-strong);
  -webkit-backdrop-filter: var(--nv-blur-strong);
  border-left: 1px solid var(--nv-border-soft);
  box-shadow: var(--nv-shadow-3);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--nv-dur-normal) var(--nv-ease-out),
    visibility var(--nv-dur-normal) var(--nv-ease-out);
}

.nv-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.nv-drawer__shade {
  position: fixed;
  inset: 0;
  z-index: calc(var(--nv-z-drawer) - 1);
  background: rgba(0, 0, 0, .32);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--nv-dur-normal) var(--nv-ease-out), visibility var(--nv-dur-normal);
}

.nv-drawer__shade.is-open {
  opacity: 1;
  visibility: visible;
}

.nv-drawer__link {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--nv-space-3);
  min-height: var(--nv-tap-min);
  padding: var(--nv-space-2) var(--nv-space-3);
  border-radius: var(--nv-radius-md);
  font-size: var(--nv-fs-body);
  font-weight: var(--nv-weight-medium);
  color: var(--nv-text-primary);
}

.nv-drawer__link:hover {
  background-color: var(--nv-brand-softer);
  color: var(--nv-text-primary);
}

.nv-drawer__link svg {
  width: 17px;
  height: 17px;
  color: var(--nv-text-muted);
}

.nv-drawer__link.is-danger {
  color: var(--nv-danger-ink);
}

.nv-drawer__link.is-danger svg {
  color: var(--nv-danger);
}

.nv-drawer .nv-user-block,
.nv-drawer .nv-guest-block,
.nv-drawer > .nv-flex {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.nv-drawer__sep {
  flex: 0 0 auto;
  height: 1px;
  margin: var(--nv-space-3) 0;
  background: var(--nv-border-soft);
}

html.nv-drawer-open {
  overflow: hidden;
}

.nv-drop {
  position: relative;
}

.nv-drop__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  padding: var(--nv-space-2);
  background-color: var(--nv-glass-strong);
  backdrop-filter: var(--nv-blur-strong);
  -webkit-backdrop-filter: var(--nv-blur-strong);
  border: 1px solid var(--nv-border-soft);
  border-radius: var(--nv-radius-card);
  box-shadow: var(--nv-shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--nv-dur-fast) var(--nv-ease-out),
    transform var(--nv-dur-fast) var(--nv-ease-out),
    visibility var(--nv-dur-fast);
}

.nv-drop.is-open .nv-drop__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nv-drop__item {
  display: flex;
  align-items: center;
  gap: var(--nv-space-2);
  min-height: 38px;
  padding: var(--nv-space-2) var(--nv-space-3);
  border-radius: var(--nv-radius-sm);
  font-size: var(--nv-fs-caption);
  color: var(--nv-text-primary);
  cursor: pointer;
}

.nv-drop__item:hover {
  background-color: var(--nv-brand-softer);
  color: var(--nv-text-primary);
}

.nv-drop__item.is-active {
  color: var(--nv-brand-ink);
  font-weight: var(--nv-weight-medium);
}

.nv-footer .nv-brand__mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.nv-footer .nv-brand__name {
  font-size: var(--nv-fs-body);
  font-weight: var(--nv-weight-bold);
  letter-spacing: var(--nv-ls-heading);
}

@media print {
  .nv-header, .nv-drawer, .nv-drawer__shade, .nv-footer, .nv-burger {
    display: none !important;
  }
}

.nv-user-block,
.nv-guest-block {
  display: flex;
  align-items: center;
  gap: var(--nv-space-2);
}

.nv-drop__sep {
  height: 1px;
  margin: var(--nv-space-1) 0;
  background-color: var(--nv-border-soft);
}

.nv-user-btn img {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.nv-user-name {
  font-size: var(--nv-fs-caption);
  color: var(--nv-text-primary);
}

.nv-header {
  position: static;
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
}

.nv-header::before {
  display: none;
}

.nv-topbar {
  position: relative;
  z-index: calc(var(--nv-z-header) + 1);
  background-image: linear-gradient(135deg, #1d4ed8 0%, #0369a1 100%);
  color: #fff;
}

.nv-topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--nv-space-3);
  min-height: 52px;
}

.nv-topbar__tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: var(--nv-radius-chip);
  background: rgba(255, 255, 255, .22);
  font-size: 12px;
  font-weight: var(--nv-weight-medium);
  letter-spacing: .02em;
}

.nv-topbar__text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nv-topbar__text :where(p, span, strong, b, em, i, font, a, div) {
  color: inherit !important;
  font-size: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
}

.nv-topbar__text a,
.nv-topbar__text a:hover,
.nv-topbar__text a:focus,
.nv-topbar__text a:active {
  text-decoration: none;
}

.nv-topbar__text a:hover {
  opacity: .85;
}

.nv-topbar__text a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .7);
  outline-offset: 2px;
  border-radius: 3px;
}

.nv-topbar__text > :where(p, div, span, a) {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nv-topbar__text > p:empty {
  display: none;
}

.nv-topbar__link,
.nv-topbar__link:hover,
.nv-topbar__link:focus,
.nv-topbar__link:active {
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer;
}

.nv-topbar__link:hover {
  opacity: .85;
}

.nv-topbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.nv-topbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--nv-radius-chip);
  font-size: 13px;
  line-height: 1;
  color: inherit;
  white-space: nowrap;
  transition: background-color var(--nv-dur-fast) var(--nv-ease-out),
              color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-topbar__btn:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.nv-topbar__btn:active {
  background: rgba(255, 255, 255, .28);
}

.nv-topbar__btn .material-icons-outlined {
  font-size: var(--nv-icon-sm);
}

.nv-mainbar {
  position: sticky;
  top: 0;
  z-index: var(--nv-z-header);
  background: var(--nv-elevated);
  border-bottom: 1px solid var(--nv-border-soft);
}

.nv-mainbar__inner {
  display: flex;
  align-items: center;
  gap: var(--nv-space-6);
  min-height: 100px;
}

.nv-mainbar__right {
  display: flex;
  align-items: center;
  gap: var(--nv-space-2);
  margin-left: auto;
  flex: 0 0 auto;
}

.nv-mainbar .nv-brand {
  align-items: center;
}

.nv-mainbar .nv-brand__mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
}

.nv-mainbar .nv-brand__name {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.nv-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius-md);
  background: var(--nv-elevated);
  font-size: 13px;
  line-height: 1;
  color: var(--nv-text-primary);
  white-space: nowrap;
  transition: background-color var(--nv-dur-fast) var(--nv-ease-out),
    border-color var(--nv-dur-fast) var(--nv-ease-out),
    color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-ghost-btn:hover {
  background: var(--nv-soft);
  border-color: var(--nv-border);
  color: var(--nv-text-primary);
}

.nv-ghost-btn:active {
  background: var(--nv-muted);
  color: var(--nv-text-primary);
}

.nv-ghost-btn .material-icons-outlined {
  font-size: var(--nv-icon-sm);
  color: var(--nv-text-muted);
  transition: color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-ghost-btn:hover .material-icons-outlined {
  color: var(--nv-text-secondary);
}

.nv-ghost-btn--primary {
  background: var(--nv-brand-solid);
  color: #fff;
  border-color: transparent;
}

.nv-ghost-btn--primary:hover {
  background: var(--nv-brand-hover);
  color: #fff;
}

.nv-ghost-btn--primary:active {
  background: var(--nv-brand-ink);
  color: #fff;
}

.nv-ghost-btn--primary .material-icons-outlined,
.nv-ghost-btn--primary:hover .material-icons-outlined {
  color: #fff;
}

.nv-user-btn {
  padding: 0 14px;
  gap: 8px;
}

.nv-user-btn__txt {
  white-space: nowrap;
}

.nv-user-btn .nv-user-ph {
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 900px) {
  .nv-user-btn {
    padding: 0 10px;
  }

  .nv-user-btn__txt {
    display: none;
  }
}

.nv-mainbar .nv-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 760px;
  margin-inline: auto;
  width: auto;
  height: 48px;
  padding: 0;
  gap: 0;
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius-md);
  background-color: var(--nv-elevated);
  overflow: hidden;
}

.nv-mainbar .nv-search:focus-within {
  border-color: var(--nv-brand);
  background-color: var(--nv-elevated);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.nv-mainbar .nv-search__ico {
  margin-left: 16px;
  flex: 0 0 auto;
  font-size: 17px;
}

.nv-mainbar .nv-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  font-size: 15px;
}

.nv-mainbar .nv-search__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 22px;
  border-radius: 0;
  background-image: none;
  background-color: var(--nv-brand-solid);
  color: #fff;
  font-size: 14px;
  font-weight: var(--nv-weight-medium);
  transition: background-color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-mainbar .nv-search__btn:hover {
  opacity: 1;
  background-color: var(--nv-brand-hover);
}

.nv-mainbar .nv-search__btn .material-icons-outlined {
  font-size: 16px;
}

.nv-subbar {
  background: var(--nv-elevated);
  border-bottom: 1px solid var(--nv-border);
}

.nv-subbar__inner {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nv-subbar__inner::-webkit-scrollbar {
  display: none;
}

.nv-subbar__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--nv-radius-btn);
  font-size: 14px;
  color: var(--nv-text-secondary);
  white-space: nowrap;
  transition: background-color var(--nv-dur-fast) var(--nv-ease-out),
              color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-subbar__link:hover {
  background: var(--nv-soft);
  color: var(--nv-text-primary);
}

.nv-subbar__link .material-icons-outlined {
  font-size: 18px;
  color: var(--nv-text-muted);
  transition: color var(--nv-dur-fast) var(--nv-ease-out);
}

.nv-subbar__link:hover .material-icons-outlined {
  color: var(--nv-text-secondary);
}

.nv-subbar__link.is-active {
  background: var(--nv-brand-softer);
  color: var(--nv-brand-ink);
  font-weight: var(--nv-weight-bold);
}

.nv-subbar__link.is-active .material-icons-outlined {
  color: var(--nv-brand-ink);
}

.nv-subbar__link.is-active:hover {
  background: var(--nv-brand-soft);
  color: var(--nv-brand-ink);
}

@media (max-width: 1023px) {
  .nv-mainbar__inner {
    gap: var(--nv-space-3);
    min-height: 76px;
  }

  .nv-ghost-btn span:not(.material-icons-outlined) {
    display: none;
  }

  .nv-ghost-btn {
    padding: 0 10px;
  }

  .nv-topbar__btn span:not(.material-icons-outlined) {
    display: none;
  }

  .nv-brand__name {
    font-size: 20px;
  }

  .nv-mainbar .nv-search {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin-inline: 0;
    height: 44px;
    order: 0;
  }

  .nv-mainbar .nv-search__btn {
    flex: 0 0 32px;
    width: 32px;
    height: 100%;
    padding: 0;
    justify-content: center;
    border-radius: 0;
  }

  .nv-mainbar .nv-search__btn span:not(.material-icons-outlined) {
    display: none;
  }

  .nv-mainbar .nv-search__btn .material-icons-outlined {
    font-size: 17px;
  }

  .nv-mainbar .nv-search__ico {
    margin-left: 4px;
    font-size: 16px;
  }

  .nv-mainbar .nv-search__input {
    padding: 0 2px 0 3px;
    font-size: 14px;
  }

  .nv-search-toggle {
    display: none !important;
  }

  .nv-order-query {
    display: none !important;
  }

  .nv-mainbar .nv-brand__name {
    display: none;
  }

  .nv-mainbar .nv-brand {
    flex: 0 0 auto;
  }

  .nv-mainbar__right {
    gap: 8px;
  }

  .nv-mainbar__right .nv-ghost-btn,
  .nv-mainbar__right .nv-user-btn {
    height: 44px;
    min-height: 44px;
  }

  .nv-mainbar__right .nv-burger {
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 640px) {
  .nv-topbar__text {
    font-size: 12px;
  }

  .nv-brand__name {
    font-size: 17px;
  }

  .nv-subbar__inner {
    min-height: 46px;
    gap: 2px;
  }

  .nv-subbar__link {
    font-size: 13px;
    padding: 0 10px;
    gap: 5px;
    height: 34px;
  }

  .nv-subbar__link .material-icons-outlined {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .nv-subbar__inner {
    overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  }
}

@media (min-width: 1024px) {
  .nv-search-toggle {
    display: none;
  }
}

.nv-user-btn > img {
  border-radius: 50%;
  object-fit: cover;
}

.nv-user-name {
  pointer-events: none;
}
