/* header.css - top nav + mega menus + mobile drawer + 3 buttons */
/* =====================================================
   Header (顶部导航)
   ===================================================== */
.byc-hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.byc-hdr.is-scrolled { background: rgba(255,255,255,0.98); box-shadow: 0 6px 20px rgba(15, 23, 42, .10), 0 2px 4px rgba(15, 23, 42, .06); }
.byc-hdr-main { padding: 12px 0; }
.byc-hdr-row { display: flex; align-items: center; gap: 32px; }

.byc-hdr-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; transition: transform 0.3s ease; }
.byc-hdr-logo:hover { transform: scale(1.02); }
.byc-hdr-logo-text { font-size: 18px; font-weight: 700; color: #3860F4; letter-spacing: 0.5px; }
.byc-hdr-logo-img { max-height: 48px; width: auto; display: block; }
.byc-hdr-logo-sub {
  padding-left: 10px; margin-left: 4px;
  border-left: 1px solid #d9e1ec;
  font-size: 12px; color: #4d5d7a; font-weight: 400;
  letter-spacing: .2px;
  white-space: nowrap;
}
@media (max-width: 1280px) { .byc-hdr-logo-sub { display: none; } }

.byc-hdr-nav { display: none; }
@media (min-width: 1200px) { .byc-hdr-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; } }
.byc-hdr-nav-item { position: relative; }

.byc-hdr-link {
  display: flex; align-items: center; gap: 5px;
  padding: 22px 15px;
  font-size: 15px; font-weight: 500;
  color: #4d5d7a;
  transition: color 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.byc-hdr-link::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 0; height: 3px;
  background: #3860F4;
  border-radius: 2px 2px 0 0;
  transition: width 0.25s ease;
}
.byc-hdr-link:hover { color: #3860F4; }
.byc-hdr-link:hover::after { width: 24px; }
.byc-hdr-link.is-current { color: #3860F4; font-weight: 600; }
.byc-hdr-link.is-current::after { width: 24px; }
.byc-hdr-link.is-active { color: #3860F4; font-weight: 600; }

/* 顶部搜索框 (dn23 范式) */
.byc-hdr-search {
  display: none;
  align-items: center; gap: 8px;
  padding: 8px 14px;
  background: #f5f7fa;
  border: 1px solid #e8ecf3;
  border-radius: 18px;
  width: 220px;
  transition: all .2s;
}
@media (min-width: 1280px) { .byc-hdr-search { display: flex; } }
.byc-hdr-search:focus-within { background: #fff; border-color: #3860F4; box-shadow: 0 0 0 3px rgba(56,96,244,.1); }
.byc-hdr-search svg { width: 14px; height: 14px; color: #888; flex-shrink: 0; }
.byc-hdr-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; color: #292929; font-family: inherit; }
.byc-hdr-search input::placeholder { color: #b4bbc7; }

/* 顶部登录按钮 (白底 + 浅蓝边 + 主蓝字, hover 浅蓝填) */
.byc-hdr-btn-login-new {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 22px;
  background: #fff;
  color: #3860F4;
  border: 1px solid #C9D2FC;
  border-radius: 4px;
  font-size: 14px; font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
}
.byc-hdr-btn-login-new:hover {
  background: #F5F7FE;
  border-color: #3860F4;
}

/* 顶部立即注册按钮 (主蓝实色渐变, 14px 跟 nav 字号一致) */
.byc-hdr-btn-reg-new {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 22px;
  background: linear-gradient(135deg, #3860F4 0%, #1E3FCC 100%);
  color: #fff !important;
  border: 1px solid #3860F4;
  border-radius: 4px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 12px rgba(56,96,244,.20);
  transition: all .2s;
  white-space: nowrap;
}
.byc-hdr-btn-reg-new:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(56,96,244,.32); }
.byc-hdr-caret { width: 12px; height: 8px; color: currentColor; position: relative; z-index: 1; transition: transform 0.3s ease; }
.byc-hdr-nav-item:hover .byc-hdr-caret { transform: rotate(180deg); }

.byc-hdr-mega {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 580px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}
.byc-hdr-mega::before {
  content: ''; position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: #fff;
  border-left: 1px solid rgba(0,0,0,0.06);
  border-top: 1px solid rgba(0,0,0,0.06);
}
.byc-hdr-nav-item:hover .byc-hdr-mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.byc-hdr-mega-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }

.byc-hdr-mega-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
.byc-hdr-mega-item::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(43,109,232,0.08), rgba(99,102,241,0.08));
  opacity: 0; transition: opacity 0.25s ease;
}
.byc-hdr-mega-item:hover::before { opacity: 1; }
.byc-hdr-mega-item:hover { transform: translateX(4px); }
.byc-hdr-mega-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; z-index: 1;
  transition: transform 0.25s ease;
}
.byc-hdr-mega-ico .ico { width: 22px; height: 22px; display: block; }
.byc-hdr-mega-item:hover .byc-hdr-mega-ico { transform: scale(1.08); }
.byc-hdr-mega-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.byc-hdr-mega-text b { display: block; font-size: 14px; font-weight: 600; color: var(--byc-text); margin-bottom: 3px; transition: color 0.25s ease; }
.byc-hdr-mega-text i { display: block; font-size: 12px; color: var(--byc-text-mut); font-style: normal; line-height: 1.4; }
.byc-hdr-mega-item:hover .byc-hdr-mega-text b { color: var(--byc-primary); }

/* Actions — 登录/注册按钮在所有屏幕始终可见 (UX P0: mobile 用户找不到登录入口) */
.byc-hdr-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.byc-hdr-actions[hidden] { display: none; }
.byc-hdr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; height: 36px; padding: 0 14px;
  font-size: 13px; font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative; overflow: hidden;
}
@media (min-width: 1200px) {
  .byc-hdr-actions { gap: 10px; margin-left: 0; }
  .byc-hdr-btn { height: 40px; padding: 0 22px; font-size: 14px; border-radius: 10px; }
}
/* 控制台按钮: mobile 隐藏 (省空间), mnav 里仍有 */
.byc-hdr-actions .byc-hdr-btn-console { display: none; }
@media (min-width: 1200px) {
  .byc-hdr-actions .byc-hdr-btn-console { display: inline-flex; }
}
.byc-hdr-btn-login { color: var(--byc-primary); background: rgba(43,109,232,0.08); }
.byc-hdr-btn-login:hover { color: #fff; background: var(--byc-primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(43,109,232,0.3); }
.byc-hdr-btn-reg { color: #fff; background: linear-gradient(135deg, #2B6DE8 0%, #6366F1 100%); box-shadow: 0 4px 12px rgba(43,109,232,0.25); }
.byc-hdr-btn-reg svg { width: 16px; height: 16px; animation: bycPulse 2s ease-in-out infinite; }
.byc-hdr-btn-reg::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.byc-hdr-btn-reg:hover::before { left: 100%; }
.byc-hdr-btn-reg:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(43,109,232,0.4); }
@keyframes bycPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.byc-hdr-toggle { display: flex; flex-direction: column; gap: 5px; padding: 8px; z-index: 1001; background: transparent; }
@media (min-width: 1200px) { .byc-hdr-toggle { display: none; } }
.byc-hdr-toggle span { display: block; width: 22px; height: 2px; background: var(--byc-text); border-radius: 2px; transition: var(--byc-trans); }
.byc-hdr-toggle.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.byc-hdr-toggle.is-active span:nth-child(2) { opacity: 0; }
.byc-hdr-toggle.is-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.byc-mnav {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  padding: 80px 16px 24px;
  overflow-y: auto;
  opacity: 0; visibility: hidden;
  transition: var(--byc-trans);
  z-index: 999;
}
.byc-mnav.is-open { opacity: 1; visibility: visible; }
.byc-mnav-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--byc-border);
  font-size: 16px; font-weight: 500; color: var(--byc-text);
}
.byc-mnav-link:hover { color: var(--byc-primary); }
.byc-mnav-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--byc-border); }
.byc-mnav-actions[hidden] { display: none; }
.byc-mnav-actions .byc-hdr-btn { width: 100%; height: 48px; font-size: 15px; }

/* mobile 抽屉里的用户卡 (已登录) */
.byc-mnav-user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--byc-primary-50, #EBF3FF);
  border-radius: 10px;
  margin-bottom: 4px;
}
.byc-mnav-user-card-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--byc-grad-primary, linear-gradient(135deg, #2B6DE8, #5B8DEF));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}
.byc-mnav-user-card-info { flex: 1; min-width: 0; }
.byc-mnav-user-card-name {
  font-size: 15px; font-weight: 600; color: var(--byc-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.byc-mnav-user-card-bal { font-size: 12px; color: var(--byc-text-sec); margin-top: 2px; }
.byc-mnav-user-card-bal strong { color: var(--byc-accent, #FF6A00); font-weight: 700; }

/* ===================== 已登录态: 用户下拉菜单 (桌面 + tablet) ===================== */
.byc-hdr-actions-user[hidden] { display: none; }
.byc-hdr-user { position: relative; }
.byc-hdr-user-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 8px 0 4px;
  background: transparent; border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit; font-size: 13px; color: var(--byc-text);
  cursor: pointer;
  transition: all 0.2s ease;
}
@media (min-width: 1200px) {
  .byc-hdr-user-trigger { height: 40px; font-size: 14px; }
}
.byc-hdr-user-trigger:hover { background: var(--byc-primary-50, #EBF3FF); border-color: var(--byc-primary-100, #D6E7FF); }
.byc-hdr-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--byc-grad-primary, linear-gradient(135deg, #2B6DE8, #5B8DEF));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}
@media (min-width: 1200px) { .byc-hdr-user-avatar { width: 32px; height: 32px; font-size: 14px; } }
.byc-hdr-user-name {
  max-width: 100px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}
@media (max-width: 767px) { .byc-hdr-user-name { display: none; } }
.byc-hdr-user-caret { width: 10px; height: 7px; color: var(--byc-text-mut, #8C92A4); transition: transform 0.2s ease; flex-shrink: 0; }
.byc-hdr-user.is-open .byc-hdr-user-caret { transform: rotate(180deg); }

.byc-hdr-user-pop {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--byc-border, #E8EBF0);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  padding: 8px;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  z-index: 1000;
}
.byc-hdr-user.is-open .byc-hdr-user-pop { opacity: 1; visibility: visible; transform: translateY(0); }

.byc-hdr-user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(43,109,232,0.08), rgba(91,141,239,0.08));
  border-radius: 10px;
  margin-bottom: 6px;
}
.byc-hdr-user-card-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--byc-grad-primary, linear-gradient(135deg, #2B6DE8, #5B8DEF));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}
.byc-hdr-user-card-info { flex: 1; min-width: 0; }
.byc-hdr-user-card-name {
  font-size: 14px; font-weight: 600; color: var(--byc-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.byc-hdr-user-card-bal { font-size: 12px; color: var(--byc-text-sec); margin-top: 2px; }
.byc-hdr-user-card-bal strong { color: var(--byc-accent, #FF6A00); font-weight: 700; }

.byc-hdr-user-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-size: 13px; color: var(--byc-text);
  background: transparent; border: 0; border-radius: 8px;
  cursor: pointer; text-align: left;
  font-family: inherit;
  transition: background 0.15s ease;
}
.byc-hdr-user-link:hover { background: var(--byc-primary-50, #EBF3FF); color: var(--byc-primary, #2B6DE8); }
.byc-hdr-user-link .ico { width: 16px; height: 16px; color: var(--byc-text-mut, #8C92A4); flex-shrink: 0; }
.byc-hdr-user-link:hover .ico { color: var(--byc-primary, #2B6DE8); }
.byc-hdr-user-divider { height: 1px; background: var(--byc-border, #E8EBF0); margin: 6px 4px; }
.byc-hdr-user-logout { color: var(--byc-text-sec, #5A6178); }
.byc-hdr-user-logout:hover { background: rgba(239,68,68,0.08); color: var(--byc-red, #EF4444); }
.byc-hdr-user-logout:hover .ico { color: var(--byc-red, #EF4444); }


/* ===================== 顶部按钮 (控制台/登录/注册 三态) ===================== */
.byc-hdr-btn-console {
  color: var(--byc-text-mut, #5A6178);
  background: transparent;
  border: 1px solid var(--byc-border, #E8EBF0);
}
.byc-hdr-btn-console:hover {
  color: var(--byc-primary, #2B6DE8);
  border-color: var(--byc-primary, #2B6DE8);
  background: var(--byc-primary-50, #EBF3FF);
}
.byc-hdr-btn-login {
  color: var(--byc-primary, #2B6DE8);
  background: var(--byc-primary-50, #EBF3FF);
  border: 1px solid var(--byc-primary-50, #EBF3FF);
}
.byc-hdr-btn-login:hover {
  background: var(--byc-primary-100, #D6E5FF);
  border-color: var(--byc-primary-100, #D6E5FF);
}
.byc-hdr-btn-reg {
  color: #fff;
  background: var(--byc-grad-primary, linear-gradient(135deg, #2B6DE8, #4D8BFF));
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.byc-hdr-btn-reg svg { width: 14px; height: 14px; }
.byc-hdr-btn-reg:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43,109,232,0.35);
}


/* =====================================================
   Header Icons — mask-image + Data URI 内嵌
   - 撤 inline SVG / PNG <img>, 改 CSS mask-image
   - background-color: currentColor 自动跟随父类 color (hover 变色)
   - 9 个 icon: 3 mega menu + 1 user caret + 5 user pop link
   ===================================================== */
.byc-hdr-mega-ico .ico,
.byc-hdr-user-link .ico,
.byc-hdr-user-caret {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: contain;
          mask-size: contain;
  flex-shrink: 0;
  -webkit-mask-image: var(--byc-ico);
          mask-image: var(--byc-ico);
}

/* mega menu 3 (24x24, 白色 stroke, 显示在彩色 .byc-hdr-mega-ico bg 内) */
.ico-mega-server {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M3 15a4 4 0 014-4h10a4 4 0 014 4v0a4 4 0 01-4 4H7a4 4 0 01-4-4v0z' stroke='black' stroke-width='1.6'/><circle cx='7' cy='15' r='1.2' fill='black'/><path d='M8 8l1-2h6l1 2' stroke='black' stroke-width='1.6' stroke-linecap='round'/></svg>");
}
.ico-mega-host {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M3 7h7l2 2h9v10a1 1 0 01-1 1H4a1 1 0 01-1-1V7z' stroke='black' stroke-width='1.6' stroke-linejoin='round'/></svg>");
}
.ico-mega-idc {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6l8-3z' stroke='black' stroke-width='1.6' stroke-linejoin='round'/><path d='M9 12l2 2 4-4' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* user caret (12x8 ▼, 跟用户菜单 color 一致, .is-open 时 transform rotate(180)) */
.byc-hdr-user-caret {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* user pop 5 link icons (16x16, 跟父类 color 一致, hover 变主蓝, logout hover 变红) */
.ico-user-dash {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M2 3h12v2H2V3zm0 4h12v2H2V7zm0 4h12v2H2v-2z'/></svg>");
}
.ico-user-order {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 2h10l1 3v9H2V5l1-3zm0 3h10V3H3v2zm2 3h6v1H5V8zm0 3h4v1H5v-1z'/></svg>");
}
.ico-user-money {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.5 3h1v1.2c1.2.2 2 1 2 2.1h-1c0-.7-.6-1.3-1.5-1.3S6.5 6.6 6.5 7c0 .4.5.7 1.6 1 1.5.4 2.4.9 2.4 2 0 1.1-.8 1.9-2 2.1V13h-1v-1c-1.3-.2-2.2-1-2.2-2.2h1c0 .8.7 1.4 1.7 1.4s1.5-.5 1.5-1c0-.5-.7-.8-1.7-1.1C5.3 8.7 4.5 8.2 4.5 7c0-1 .7-1.7 2-2V4z'/></svg>");
}
.ico-user-ticket {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 1h7l3 3v11H3V1zm1 1v12h8V5h-3V2H4z'/></svg>");
}
.ico-user-logout {
  --byc-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M6 2H3v12h3v-1H4V3h2V2zm4 3l-1 .7L11.6 8H6v1h5.6L9 11.3l1 .7 4-4-4-4z'/></svg>");
}

