/* Shared WEEX app header — single source for dashboard + futures */

:root {
  --wx-bg: #000000;
  --wx-surface: #121212;
  --wx-surface-2: #1e1e1e;
  --wx-border: #2b2f36;
  --wx-text: #ffffff;
  --wx-muted: #848e9c;
  --wx-yellow: #f0b90b;
  --wx-green: #2ebd85;
  --wx-red: #f6465d;
  --wx-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wx-nav-h: 56px;
}

.wx-nav {
  height: var(--wx-nav-h);
  min-height: var(--wx-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--wx-border);
  background: var(--wx-bg);
  flex-shrink: 0;
  font-family: var(--wx-font);
  overflow: visible;
}

.app-header--sticky {
  position: sticky;
  top: 0;
  z-index: 50;
}

.wx-nav a {
  color: inherit;
  text-decoration: none;
}

.wx-nav-left,
.wx-nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.wx-nav-left {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.wx-nav-left::-webkit-scrollbar {
  display: none;
}

.wx-nav-logo {
  height: 28px;
  margin-right: 20px;
  flex-shrink: 0;
}

.wx-nav-link {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--wx-text);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.wx-nav-link:hover {
  color: var(--wx-yellow);
}

.wx-nav-link--active {
  color: var(--wx-yellow);
}

.wx-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 2px;
  background: rgba(240, 185, 11, 0.15);
  color: var(--wx-yellow);
  font-weight: 500;
}

.wx-pill--hot {
  background: rgba(246, 70, 93, 0.15);
  color: var(--wx-red, #f6465d);
}

.wx-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  color: var(--wx-muted);
  font-size: 16px;
  transition: color 0.15s ease, background 0.15s ease;
}

.wx-nav-icon:hover {
  color: var(--wx-text);
  background: var(--wx-surface-2);
}

.wx-notify-wrap {
  position: relative;
}

.wx-notify-btn {
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.wx-notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--wx-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--wx-bg);
}

.wx-notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--wx-surface);
  border: 1px solid var(--wx-border);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  z-index: 10060;
  overflow: hidden;
}

.wx-notify-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--wx-border);
}

.wx-notify-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--wx-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wx-notify-head-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--wx-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.wx-notify-list {
  max-height: min(60vh, 360px);
  overflow-y: auto;
}

.wx-notify-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--wx-border);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.wx-notify-item:last-child {
  border-bottom: none;
}

.wx-notify-item:hover {
  background: var(--wx-surface-2);
}

.wx-notify-item.is-unread {
  background: rgba(240, 185, 11, 0.06);
}

.wx-notify-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.wx-notify-icon--success { background: rgba(46, 189, 133, 0.15); color: var(--wx-green); }
.wx-notify-icon--warning { background: rgba(240, 185, 11, 0.15); color: var(--wx-yellow); }
.wx-notify-icon--danger { background: rgba(246, 70, 93, 0.15); color: var(--wx-red); }
.wx-notify-icon--info { background: rgba(132, 142, 156, 0.15); color: var(--wx-muted); }
.wx-notify-icon--support { background: rgba(132, 142, 156, 0.15); color: #7eb6ff; }
.wx-notify-icon--gold { background: rgba(240, 185, 11, 0.15); color: var(--wx-yellow); }
.wx-notify-icon--purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.wx-notify-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wx-notify-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--wx-text);
  line-height: 1.35;
}

.wx-notify-item.is-unread .wx-notify-item-title {
  color: var(--wx-yellow);
}

.wx-notify-item-msg {
  font-size: 11px;
  color: var(--wx-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wx-notify-item-time {
  font-size: 10px;
  color: var(--wx-muted);
}

.wx-notify-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--wx-muted);
}

.wx-notify-empty-icon {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.wx-notify-empty p {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--wx-text);
}

.wx-notify-empty span {
  font-size: 11px;
}

.wx-notify-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--wx-border);
  text-align: center;
}

.wx-notify-foot a {
  font-size: 12px;
  font-weight: 600;
  color: var(--wx-yellow);
  text-decoration: none;
}

.wx-notify-foot a:hover {
  text-decoration: underline;
}

.wx-nav-btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.wx-nav-btn--primary {
  background: var(--wx-yellow);
  color: #000;
  font-weight: 600;
}

.wx-nav-btn--primary:hover {
  background: #c99408;
  color: #000;
}

.wx-balance {
  font-size: 13px;
  color: var(--wx-muted);
  margin-right: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.wx-balance strong {
  color: var(--wx-text);
}

/* Profile dropdown */
.wx-user-wrap {
  position: relative;
}

.wx-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wx-text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
  max-width: 180px;
}

.wx-user-btn:hover {
  background: var(--wx-surface-2);
}

.wx-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--wx-yellow), #c99408);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.wx-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wx-user-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.wx-user-meta {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
}

@media (min-width: 768px) {
  .wx-user-meta {
    display: flex;
  }
}

.wx-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--wx-text);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-user-role {
  font-size: 11px;
  color: var(--wx-muted);
}

.wx-user-chevron {
  display: none;
  color: var(--wx-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.wx-user-chevron.is-open {
  transform: rotate(180deg);
}

@media (min-width: 768px) {
  .wx-user-chevron {
    display: block;
  }
}

.wx-user-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 264px;
  max-width: calc(100vw - 24px);
  background: var(--wx-surface);
  border: 1px solid var(--wx-border);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  z-index: 10060;
  overflow: hidden;
}

.wx-user-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--wx-border);
}

.wx-user-panel-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wx-user-balance {
  font-size: 12px;
  color: var(--wx-muted);
}

.wx-user-panel-menu {
  padding: 6px;
}

.wx-user-panel-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wx-text);
  font-size: 13px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wx-user-panel-link:hover {
  background: var(--wx-surface-2);
  color: var(--wx-yellow);
}

.wx-user-panel-link svg {
  flex-shrink: 0;
  color: var(--wx-muted);
}

.wx-user-panel-link:hover svg {
  color: var(--wx-yellow);
}

.wx-user-panel-divider {
  height: 1px;
  margin: 6px 0;
  background: var(--wx-border);
}

.wx-user-panel-link--danger {
  color: var(--wx-red);
}

.wx-user-panel-link--danger:hover {
  background: rgba(246, 70, 93, 0.1);
  color: var(--wx-red);
}

.wx-user-panel-link--danger:hover svg {
  color: var(--wx-red);
}

/* Public site header */
.wx-nav--transparent {
  position: fixed;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom-color: transparent;
}

.wx-nav--transparent.is-scrolled {
  background: var(--wx-bg);
  border-bottom-color: var(--wx-border);
  backdrop-filter: blur(12px);
}

.wx-nav-login {
  color: var(--wx-muted) !important;
}

.wx-nav-login:hover {
  color: var(--wx-yellow) !important;
}

.wx-balance--public {
  display: none;
}

.wx-public-menu-btn {
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.wx-public-mobile {
  display: none;
  position: fixed;
  inset: 56px 0 0;
  z-index: 49;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}

.wx-public-mobile.is-open {
  display: block;
}

.wx-public-mobile-inner {
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wx-public-mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 6px;
  color: var(--wx-text);
  text-decoration: none;
  font-size: 14px;
}

.wx-public-mobile-link:hover,
.wx-public-mobile-link.is-active {
  background: var(--wx-surface-2);
  color: var(--wx-yellow);
}

.wx-public-mobile-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--wx-border);
}

.wx-nav-btn--block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.wx-nav-btn--ghost {
  background: transparent;
  color: var(--wx-text);
  border: 1px solid var(--wx-border);
  font-weight: 600;
}

.wx-nav-btn--ghost:hover {
  background: var(--wx-surface-2);
  color: var(--wx-yellow);
}

/* More menu dropdown */
.wx-more-wrap {
  position: relative;
  flex-shrink: 0;
}

.wx-more-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--wx-text);
}

.wx-more-chevron {
  color: var(--wx-muted);
  transition: transform 0.2s ease;
}

.wx-more-chevron.is-open {
  transform: rotate(180deg);
}

.wx-more-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 240px;
  max-width: calc(100vw - 24px);
  background: var(--wx-surface);
  border: 1px solid var(--wx-border);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  z-index: 10060;
  overflow: hidden;
}

.wx-more-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--wx-border);
}

.wx-more-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--wx-text);
}

.wx-more-list {
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 6px;
}

.wx-more-featured {
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--wx-border);
}

.wx-more-item--featured {
  font-weight: 600;
}

@media (min-width: 768px) {
  .wx-more-featured {
    display: none;
  }
}

.wx-more-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wx-text);
  font-size: 13px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wx-more-item:hover,
.wx-more-item.is-active {
  background: var(--wx-surface-2);
  color: var(--wx-yellow);
}

.wx-more-item--button {
  text-align: left;
}

/* Mobile bottom navigation */
.wx-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: 56px;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--wx-bg);
  border-top: 1px solid var(--wx-border);
  font-family: var(--wx-font);
}

@media (min-width: 768px) {
  .wx-bottom-nav {
    display: none !important;
  }
}

.wx-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--wx-muted);
  font-size: 10px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 4px;
  transition: color 0.15s ease;
}

.wx-bottom-nav-item:hover,
.wx-bottom-nav-item.is-active {
  color: var(--wx-yellow);
}

.wx-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 46;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.wx-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 56px;
  z-index: 47;
  max-height: min(75vh, 520px);
  overflow-y: auto;
  background: var(--wx-surface);
  border-top: 1px solid var(--wx-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  font-family: var(--wx-font);
}

.wx-bottom-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--wx-border);
}

.wx-bottom-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
}

.wx-bottom-sheet-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--wx-text);
}

.wx-bottom-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wx-muted);
  cursor: pointer;
}

.wx-bottom-sheet-close:hover {
  background: var(--wx-surface-2);
  color: var(--wx-text);
}

.wx-bottom-sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 16px 12px;
}

.wx-bottom-sheet-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  border-radius: 8px;
  background: var(--wx-surface-2);
  border: 1px solid var(--wx-border);
  color: var(--wx-text);
  font-size: 11px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.wx-bottom-sheet-tile:hover {
  border-color: var(--wx-yellow);
  color: var(--wx-yellow);
}

.wx-bottom-sheet-tile-icon {
  font-size: 18px;
  line-height: 1;
}

.wx-bottom-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px 16px;
  border-top: 1px solid var(--wx-border);
}

.wx-bottom-sheet-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 11px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wx-text);
  font-size: 13px;
  font-family: inherit;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wx-bottom-sheet-link:hover {
  background: var(--wx-surface-2);
  color: var(--wx-yellow);
}

.wx-bottom-sheet-link--button {
  cursor: pointer;
}

@media (max-width: 767px) {
  .wx-nav-left .wx-nav-link {
    display: none;
  }

  .wx-public-menu-btn {
    display: inline-flex;
  }

  .wx-nav-right .wx-nav-login,
  .wx-nav-right .wx-nav-btn--primary,
  .wx-nav-right .wx-user-wrap,
  .wx-balance--public {
    display: none;
  }
}

@media (min-width: 768px) {
  .wx-balance--public {
    display: inline;
  }
}

@media (max-width: 639px) {
  .wx-balance {
    display: none;
  }

  .wx-nav-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

[x-cloak] {
  display: none !important;
}
