/* 顶部固定导航 */
.header {
  padding-top: max(24px, env(safe-area-inset-top));
  top: 0;
  position: fixed;
  left: 0;
  width: 100%;
  z-index: 9999;
  border-bottom: 1px solid #222;
  background-color: #121218;
  backdrop-filter: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  height: auto;
  padding: 0 20px;
  flex-wrap: nowrap !important;
}

body {
  padding-top: calc(70px + env(safe-area-inset-top, 0));
}

@supports (padding-top: constant(safe-area-inset-top)) {
  .header {
    padding-top: constant(safe-area-inset-top);
  }
  body {
    padding-top: calc(70px + constant(safe-area-inset-top));
  }
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  max-width: 40%;
}
.logo-img {
  width: auto;
  height: 48px;
  max-height: 100%;
  display: block;
}
.logo-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.logo span {
  color: #a855f7;
}

/* 导航菜单 */
.menu {
  display: flex;
  gap: 28px;
  list-style: none;
  flex: 1;
  justify-content: flex-end;
  margin-left: auto;
}
.menu-item {
  position: relative;
  font-size: 15px;
  padding: 10px 0;
  color: #ddd;
  cursor: pointer;
}
.menu-item:hover {
  color: #a855f7;
}

/* 子菜单 */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #141417;
  border: 1px solid #29292f;
  border-radius: 6px;
  display: none;
  z-index: 9999;
}
.menu-item:hover .submenu {
  display: block;
}
.submenu a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: #bbb;
}
.submenu a:hover {
  background: #a855f7;
  color: #fff;
}

/* ------------------------------
   中屏小屏：菜单永远右对齐！
------------------------------ */
@media (max-width: 768px) {
  .menu-item {
    writing-mode: vertical-rl;
    text-orientation: upright;
    padding: 6px 4px;
  }
  .submenu {
    writing-mode: horizontal-tb !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    min-width: 140px !important;
  }
}

/* ------------------------------
   最小屏：LOGO自适应大小，不写死
------------------------------ */
@media (max-width: 528px) {
  .logo-text {
    display: none;
  }
  .logo-img {
    height: clamp(40px, 8vw, 55px);
  }
}

/* ------------------------------
   彻底删除导致左对齐的坏代码
------------------------------ */
@media (max-width: 768px) {
  .nav {
    flex-wrap: nowrap !important;
    padding: 0 20px !important;
    min-height: 70px !important;
  }
  .menu {
    width: auto !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
  }
}

/* 首页横幅 */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 52px;
  margin-bottom: 16px;
  z-index: 2;
}

.hero-desc {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 36px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 6px;
  background: #a855f7;
  color: #fff;
  font-weight: 500;
  transition: .2s;
}

.btn:hover {
  background: #9333ea;
}

/* 卡片 */
.card {
  background: #16161b;
  border-radius: 10px;
  overflow: hidden;
  transition: .3s;
}

.card:hover {
  transform: translateY(6px);
}

.card-img img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card-title {
  padding: 18px;
  text-align: center;
}

/* 底部 */
.footer {
  background: #09090b;
  padding: 50px 0;
  text-align: center;
  color: #777;
  border-top: 1px solid #1b1b1f;
}

/* 横向滚动 */
.slider {
  display: flex;
  gap: 10px;
  padding: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.slide {
  flex: 0 0 280px;
  scroll-snap: start;
}

.slide img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}

/* 动画 */
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadein {
  animation: fadein 1s forwards;
}

/* 键盘焦点 */
.btn:focus-visible,
.menu-item:focus-visible,
.slider a:focus-visible,
.card:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 4px;
}

/* 响应式 */
@media (max-width: 900px) {
  .hero-title {
    font-size: 40px;
  }
  .hero-desc {
    font-size: 16px;
    margin-bottom: 28px;
  }
  .hero-inner {
    padding: 0 20px;
  }
}

@media (max-width: 640px) {
  .hero {
    height: auto;
    padding: 80px 0 40px;
  }
  .hero-title {
    font-size: 32px;
    line-height: 1.15;
  }
  .hero-desc {
    font-size: 15px;
  }
  .btn {
    width: 100%;
    max-width: 260px;
  }
  .slider {
    gap: 12px;
    padding: 16px 0;
  }
  .slide {
    flex: 0 0 240px;
  }
  .card-img img {
    height: 180px;
  }
}

/* 滚动条美化 */
.business-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 150, 255, 0.3) transparent;
}

.business-scroll::-webkit-scrollbar {
  height: 3px;
}

.business-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.business-scroll::-webkit-scrollbar-thumb {
  background: rgba(180, 150, 255, 0.4);
  border-radius: 99px;
}

/* 图片弹窗 */
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.gallery-box {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

#showImg {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}

.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(180, 150, 255, 0.3);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}

.prev { left: -60px; }
.next { right: -60px; }

/* 板块标题 */
.section-head {
  text-align: center;
  margin-bottom: 20px;
}
.section-title {
  font-size: 22px;
  color: #fff;
  margin-bottom: 4px;
}
.section-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}
.section-title::after {
  content: '';
  display: block;
  width: 45px;
  height: 2px;
  background: rgba(180,150,255,0.6);
  margin: 6px auto 0;
}

/* 链接样式 */
.card-title a {
  color: inherit;
  text-decoration: none;
}

/* ========== 导航栏用户区样式 ========== */
.nav-user-entry {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 14px;
}

/* 未登录按钮 */
#visitor-view {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 导航按钮 */
.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #bbb;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #ffc832;
}

.nav-btn-outline {
    background: rgba(255,200,50,.1);
    color: #ffc832;
    border: 1px solid rgba(255,200,50,.25);
}

.nav-btn-outline:hover {
    background: rgba(255,200,50,.18);
    color: #ffc832;
}

.nav-btn-primary {
    background: linear-gradient(90deg, #ffb832, #ffd84a);
    color: #111;
    font-weight: 600;
}

.nav-btn-primary:hover {
    opacity: .88;
    color: #111;
}

/* ========== 导航栏头像 ========== */
.user-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    overflow: hidden;
    border: 2px solid rgba(255, 200, 50, 0.3);
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.user-avatar:hover {
    border-color: #ffc832;
}

/* ========== 会员下拉菜单 ========== */
.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s;
}

.user-dropdown-trigger:hover {
    background: rgba(255,255,255,.06);
}

.user-dropdown-trigger .user-name {
    font-size: 13px;
    color: #ddd;
    font-weight: 500;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #777;
    transition: transform .2s, border-top-color .2s;
    flex-shrink: 0;
}

.user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    border-top-color: #ffc832;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 150px;
    background: #1a1a2a;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 6px 0;
    box-shadow: 0 8px 30px rgba(0,0,0,.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .22s ease;
    z-index: 99999;
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a,
.user-dropdown-menu span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.user-dropdown-menu a:hover,
.user-dropdown-menu span:hover {
    background: rgba(255,200,50,.06);
    color: #ffc832;
}

.user-dropdown-menu .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* 退出项分隔 */
.user-dropdown-menu span:last-child {
    border-top: 1px solid rgba(255,255,255,.06);
    margin-top: 3px;
    padding-top: 11px;
    color: #e07070;
}

.user-dropdown-menu span:last-child:hover {
    color: #f53f3f;
    background: rgba(245,63,63,.08);
}