:root {
  --ng-page: #eff5ff;
  --ng-ink: #14223a;
  --ng-muted: #596980;
  --ng-line: rgba(47,123,255,.2);
  --ng-accent: #2f7bff;
  --ng-accent-2: #20b6c7;
  --ng-shell-page: var(--ng-page);
  --ng-shell-text: var(--ng-ink);
  --ng-shell-muted: var(--ng-muted);
  --ng-shell-line: var(--ng-line);
  --ng-shell-primary: var(--ng-accent);
  --ng-shell-accent: var(--ng-accent-2);
  --ng-shell-surface-strong: #fff;
  --ng-shell-card-bg: linear-gradient(145deg, #fff, #eef5ff);
  --ng-shell-card-border: rgba(47,123,255,.2);
  --ng-shell-nav-bg: rgba(247,250,255,.96);
  --ng-shell-nav-pedestal: linear-gradient(180deg, #80b8ff, #2d6cd7);
  --ng-shell-nav-label-bg: #20345b;
  --ng-shell-icon-fg: #2f7bff;
  --ng-shell-nav-height: 78px;
  --ng-shell-nav-visual-height: 40px;
  --ng-shell-content-max: 920px;
  --primary: #2f6bff;
  --accent: #68a4ff;
  --text: #101828;
}
* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: #edf3ff; }
body.ng-shell {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--text);
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  background: #f4f7fb;
  padding-bottom: calc(var(--ng-shell-nav-height) + env(safe-area-inset-bottom) + 22px);
}
body.ng-shell::before {
  content: "";
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(760px 420px at 8% -8%, rgba(47,107,255,.12), transparent 66%),
    radial-gradient(620px 360px at 96% 0%, rgba(91,181,255,.1), transparent 64%),
    linear-gradient(180deg, #f7f9fc 0%, #f3f6fa 100%);
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; user-select: none; }
[hidden] { display: none !important; }

header.ng-brand-header {
  position: relative; isolation: isolate; display: block;
  width: min(1180px, calc(100% - 28px));
  min-height: 70px;
  margin: max(12px, env(safe-area-inset-top)) auto 12px;
  overflow: hidden;
  border: 1px solid #e4eaf2; border-radius: 22px;
  color: #182337; background: #fff;
  box-shadow: 0 10px 30px rgba(16,24,40,.07);
}
header.ng-brand-header::after {
  content: "";
  position: absolute; right: 16px; bottom: 0; left: 16px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: .65; pointer-events: none;
}
.ng-brand-header__row {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; width: 100%; padding: 7px 18px; gap: 12px;
}
.brand { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 0; }
.brand-logo {
  display: block;
  width: min(252px, 100%);
  max-width: 252px;
  height: 49px;
  object-fit: contain;
  object-position: left center;
}
.ng-brand-header__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ng-member-entry {
  position: relative; z-index: 3;
  display: inline-flex; align-items: center;
  appearance: none;
  flex: 0 0 auto; min-width: 108px; max-width: 174px; min-height: 42px;
  padding: 5px 12px 5px 7px; gap: 8px;
  border: 1px solid color-mix(in srgb, var(--primary) 36%, #dce7fb); border-radius: 14px;
  color: #182337; background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--primary) 8%, #fff));
  box-shadow: inset 0 1px rgba(255,255,255,.72), 0 7px 18px rgba(24,35,55,.09);
  font-size: 13px; font-weight: 800; line-height: 1; white-space: nowrap;
}
.ng-member-entry::after {
  content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: .72; pointer-events: none;
}
.ng-member-entry__visual { position: relative; display: grid; place-items: center; width: 32px; height: 32px; min-width: 32px; }
.ng-member-entry__visual::before {
  content: ""; width: 32px; height: 32px;
  background: url("/assets/member-entry.webp") center / contain no-repeat;
  transition: transform .25s ease;
}
.ng-member-entry__avatar {
  position: absolute; inset: 0; width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; display: none; z-index: 1;
}
.ng-member-entry.has-avatar .ng-member-entry__visual::before { display: none; }
.ng-member-badge { min-width: 0; max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
.ng-member-entry.is-member {
  border-color: color-mix(in srgb, #1db954 46%, #dce7fb);
  background: linear-gradient(135deg, #fff, color-mix(in srgb, #1db954 10%, #fff));
}
.ng-member-entry.is-member::after { background: linear-gradient(90deg, transparent, #1db954, var(--accent), transparent); }
.ng-member-entry.is-member .ng-member-entry__visual::before { transform: scale(1.06); }
.ng-member-entry.is-member .ng-member-entry__visual::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #1db954; border: 2px solid #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, #1db954 40%, transparent);
}

.popup-overlay {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: #0e2b6661; backdrop-filter: blur(6px);
}
.popup-modal {
  width: min(440px, 92vw); padding: 22px;
  border: 1px solid rgba(47,123,255,.18); border-radius: 20px;
  background: #fff; box-shadow: 0 24px 64px #254f9838;
}
.popup-header, .popup-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.popup-header h3 { margin: 0; font-size: 18px; }
.popup-header button { width: 34px; height: 34px; border: 0; background: transparent; color: #8aa0c0; font-size: 24px; }
.popup-modal p {
  margin: 16px 0; padding: 14px 16px;
  color: #2d4a7a;
  border: 1px solid rgba(47,123,255,.1); border-radius: 12px;
  background: #2f7bff0f; line-height: 1.85; white-space: pre-line;
}
.popup-footer { justify-content: flex-end; }
.popup-footer button, .ng-community-button {
  min-height: 38px; padding: 0 18px; border: 0; border-radius: 12px;
  color: #fff; background: linear-gradient(90deg, var(--primary), var(--accent)); font-weight: 800;
}
.ng-community-button {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.ng-community-button.ghost {
  color: #3f4f68; background: #eef4ff;
}

.ng-bottom-nav {
  position: fixed; z-index: 100; right: 50%; bottom: 0;
  width: min(100%, var(--ng-shell-content-max));
  min-height: var(--ng-shell-nav-height);
  padding: 8px 8px calc(6px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  align-items: end; background: transparent; transform: translateX(50%);
}
.ng-bottom-nav::before {
  content: ""; position: absolute; z-index: 0; right: 0; bottom: 0; left: 0;
  height: calc(var(--ng-shell-nav-visual-height) + env(safe-area-inset-bottom));
  background: var(--ng-shell-nav-bg);
  border: 1px solid var(--ng-shell-line); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 24px rgba(20,36,62,.12);
  backdrop-filter: blur(18px) saturate(135%);
}
.ng-bottom-nav__item {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 63px; padding: 2px 3px 1px; color: var(--ng-shell-muted);
}
.ng-bottom-nav__icon {
  position: relative; z-index: 1;
  width: 38px; height: 38px; display: grid; place-items: center;
}
.ng-bottom-nav__icon img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(11,18,31,.18));
}
.ng-bottom-nav__icon::after {
  content: ""; position: absolute; z-index: -1;
  right: -5px; bottom: -2px; left: -5px; height: 12px;
  border: 1px solid rgba(47,123,255,.38); border-radius: 50%;
  background: var(--ng-shell-nav-pedestal);
  box-shadow: 0 3px 8px rgba(11,18,31,.22);
}
.ng-bottom-nav__label {
  position: relative; z-index: 2;
  min-width: 42px; max-width: 100%; margin-top: -2px; padding: 2px 7px 3px;
  overflow: hidden; color: #fff; font-size: 10px; font-weight: 720;
  white-space: nowrap; text-overflow: ellipsis; text-align: center;
  border: 1px solid rgba(47,123,255,.3); border-radius: 999px;
  background: var(--ng-shell-nav-label-bg);
}
.ng-bottom-nav__item[aria-current="page"] { color: var(--ng-shell-primary); }
.ng-bottom-nav__item[aria-current="page"] .ng-bottom-nav__icon { transform: translateY(-4px) scale(1.12); }
.ng-bottom-nav__item[aria-current="page"] .ng-bottom-nav__label {
  border-color: color-mix(in srgb, var(--ng-shell-primary) 62%, #f5d895);
  background: color-mix(in srgb, var(--ng-shell-primary) 58%, var(--ng-shell-nav-label-bg));
}
.ng-bottom-nav__item[aria-current="page"]::after {
  content: "";
  position: absolute; z-index: 2; bottom: 2px; left: 50%;
  width: 16px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: translateX(-50%);
}
.ng-bottom-nav__item--home .ng-bottom-nav__label { min-width: 50px; }

.ng-page-title {
  margin: 8px 0 12px;
  color: var(--ng-shell-text);
  font-size: clamp(24px, 3vw, 29px);
  font-weight: 800;
  line-height: 1.2;
}
.ng-community-heading { margin: 8px 0 24px; text-align: center; }
.ng-community-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 750; }
.ng-community-heading h1::after {
  content: ""; display: block; width: 96px; height: 3px; margin: 12px auto;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
}
.ng-community-heading p { margin: 0; color: var(--ng-shell-muted); font-size: 14px; }
.ng-community-nav {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px; margin: 0 0 24px; padding: 6px;
  border: 1px solid var(--ng-shell-card-border); border-radius: 18px; background: #fff;
}
.ng-community-nav a {
  display: flex; min-height: 52px; padding: 8px 12px;
  align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px;
  color: var(--ng-shell-muted); font-size: 14px; font-weight: 650;
}
.ng-community-nav a[aria-current="page"] {
  color: var(--ng-shell-text);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, #fff);
}
.ng-community-icon { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.ng-community-icon img { width: 100%; height: 100%; object-fit: contain; }
.ng-hub-shell { width: min(100% - 32px, 920px); margin: 0 auto; padding: 4px 0 42px; }
.ng-panel {
  padding: 20px;
  border: 1px solid var(--ng-shell-card-border); border-radius: 20px;
  background: var(--ng-shell-card-bg);
  box-shadow: 0 8px 24px rgba(19,40,72,.055);
}

@media (min-width: 900px) {
  .ng-bottom-nav { bottom: 16px; padding-bottom: 7px; }
  .ng-bottom-nav::before { border-bottom: 1px solid var(--ng-shell-line); border-radius: 24px; }
}
@media (max-width: 768px) {
  header.ng-brand-header { width: calc(100% - 24px); min-height: 58px; border-radius: 20px; }
  .ng-brand-header__row { min-height: 56px; padding: 6px 12px; }
  .brand-logo { max-width: 189px; height: 36px; }
  .ng-member-entry { min-width: 92px; min-height: 40px; }
  .ng-hub-shell { width: min(100% - 24px, 920px); }
  .ng-community-nav a { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 13px; }
}
