/* =====================================================================
   MIG-01 · 全局 Shell 样式
   Header（浮动胶囊导航）+ Footer（四列黑色页脚）+ 移动端抽屉导航
   所有选择器嵌套在 .ui-v2 下，避免与旧 CSS 冲突。
   ===================================================================== */

/* ============================================== Header：浮动胶囊导航 ============================================== */

.ui-v2 .floating-header {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 1400px;
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .ui-v2 .floating-header { width: 85%; }
}

@media (min-width: 1280px) {
  .ui-v2 .floating-header { width: 75%; max-width: 1200px; }
}

/* 胶囊条主体 */
.ui-v2 .pill-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.625rem;
  background: rgba(14, 15, 20, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-sizing: border-box;
}

/* 桌面导航列表 */
.ui-v2 .pill-nav .desktop-nav {
  display: none;
  align-items: center;
  gap: clamp(0.375rem, 1vw, 1.25rem);
  flex-shrink: 1;
  min-width: 0;
}

@media (min-width: 1024px) {
  .ui-v2 .pill-nav .desktop-nav { display: flex; }
}

/* 导航链接基础 */
.ui-v2 .pill-nav .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem clamp(0.35rem, 0.75vw, 0.75rem);
  font-size: clamp(0.8125rem, 0.85vw, 0.875rem);
  font-weight: 400;
  color: #d1d5db;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 9999px;
  flex-shrink: 0;
  transition: all 200ms ease;
}

.ui-v2 .pill-nav .nav-link:hover {
  color: #ffffff;
  opacity: 0.9;
}

/* 激活态胶囊高亮 */
.ui-v2 .pill-nav .nav-link[aria-current="page"] {
  padding: 0.5rem clamp(1.125rem, 1.6vw, 2rem);
  font-size: clamp(0.875rem, 0.9vw, 0.9375rem);
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(42, 45, 58, 0.9) 0%, rgba(22, 24, 33, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 15px rgba(255, 255, 255, 0.05);
}

/* 右侧操作区 */
.ui-v2 .pill-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* 个人中心渐变按钮 */
.ui-v2 .pill-nav .btn-dashboard {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem clamp(0.875rem, 1.2vw, 1.25rem);
  font-size: clamp(0.8125rem, 0.85vw, 0.875rem);
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(90deg, #7ee8fa 0%, #e084d3 100%);
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(224, 132, 211, 0.35);
  transition: all 200ms ease;
}

.ui-v2 .pill-nav .btn-dashboard:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(224, 132, 211, 0.5);
  opacity: 0.95;
}

/* 退出胶囊按钮 */
.ui-v2 .pill-nav .btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem clamp(0.75rem, 1vw, 1.125rem);
  font-size: clamp(0.8125rem, 0.85vw, 0.875rem);
  font-weight: 400;
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  white-space: nowrap;
  transition: all 200ms ease;
}

.ui-v2 .pill-nav .btn-logout:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

/* 登录/报名胶囊链接 */
.ui-v2 .pill-nav .btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem clamp(0.75rem, 1vw, 1.125rem);
  font-size: clamp(0.8125rem, 0.85vw, 0.875rem);
  font-weight: 400;
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 200ms ease;
}

.ui-v2 .pill-nav .btn-login:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.ui-v2 .pill-nav .btn-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem clamp(0.875rem, 1.2vw, 1.25rem);
  font-size: clamp(0.8125rem, 0.85vw, 0.875rem);
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(90deg, #7ee8fa 0%, #e084d3 100%);
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(224, 132, 211, 0.35);
  transition: all 200ms ease;
}

.ui-v2 .pill-nav .btn-signup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(224, 132, 211, 0.5);
  opacity: 0.95;
}

/* 汉堡菜单按钮 */
.ui-v2 .pill-nav .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.125rem;
  color: #ffffff;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .ui-v2 .pill-nav .nav-toggle { display: none; }
}

/* ============================================== 移动端抽屉导航 ============================================== */

.ui-v2 .mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 998;
}

.ui-v2 .mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background-color: #0a0a0d;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-sizing: border-box;
}

.ui-v2 .mobile-drawer.open {
  transform: translateX(0);
}

.ui-v2 .mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ui-v2 .mobile-drawer-title {
  font-weight: 600;
  font-size: 1.125rem;
  color: #ffffff;
}

.ui-v2 .mobile-drawer-close {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: #94a3b8;
  border-radius: 0.375rem;
  transition: color 150ms ease;
  cursor: pointer;
}

.ui-v2 .mobile-drawer-close:hover {
  color: #ffffff;
}

.ui-v2 .mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 1rem;
  flex: 1;
  overflow-y: auto;
}

.ui-v2 .mobile-drawer-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.ui-v2 .mobile-drawer-link:hover,
.ui-v2 .mobile-drawer-link[aria-current="page"] {
  background-color: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
}

.ui-v2 .mobile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 预留：后续登录态下在抽屉内的操作按钮 */
.ui-v2 .mobile-drawer-actions .btn {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

/* ============================================== Footer ============================================== */

.ui-v2 .site-footer {
  width: 100%;
  background-color: #000000;
  color: #a1a1aa;
  margin-top: auto;
  position: relative;
}

/* 渐变分割线 */
.ui-v2 .footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 10%,
    rgba(255, 255, 255, 0.18) 90%,
    transparent 95%
  );
}

.ui-v2 .footer-divider.top   { margin-bottom: 3.5rem; }
.ui-v2 .footer-divider.mid   { margin-top: 3.5rem; margin-bottom: 1.5rem; }

/* 主体容器 */
.ui-v2 .footer-main {
  width: 85%;
  max-width: 1400px;
  margin: 0 auto;
}

/* 四列网格 */
.ui-v2 .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
}

@media (max-width: 1024px) {
  .ui-v2 .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}

/* ---------- 移动端 Header ---------- */
@media (max-width: 640px) {
  .ui-v2 .floating-header { top: 0.75rem; width: 94%; }
  .ui-v2 .pill-nav { padding: 0.25rem 0.5rem; }
  .ui-v2 .pill-nav .nav-brand { font-size: 0.8125rem; }
  .ui-v2 .pill-nav .btn-signup { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
  .ui-v2 .pill-nav .btn-login { padding: 0.35rem 0.625rem; font-size: 0.75rem; }
  .ui-v2 .pill-nav .btn-dashboard { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
  .ui-v2 .pill-nav .nav-actions { gap: 0.25rem; }
}
@media (max-width: 380px) {
  .ui-v2 .floating-header { width: 98%; }
  .ui-v2 .pill-nav .btn-signup { padding: 0.3rem 0.5rem; font-size: 0.6875rem; }
  .ui-v2 .pill-nav .btn-login { padding: 0.3rem 0.5rem; font-size: 0.6875rem; }
  .ui-v2 .pill-nav .btn-dashboard { padding: 0.3rem 0.5rem; font-size: 0.6875rem; }
}

@media (max-width: 640px) {
  .ui-v2 .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* 品牌列 */
.ui-v2 .footer-brand-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.05em;
}

.ui-v2 .footer-brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: #71717a;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.ui-v2 .footer-brand-desc {
  font-size: 0.84375rem;
  color: #a1a1aa;
  line-height: 1.7;
  max-width: 380px;
  margin: 0;
}

/* 导航列 */
.ui-v2 .footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ui-v2 .footer-col-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #e4e4e7;
  margin: 0 0 0.5rem 0;
}

.ui-v2 .footer-link {
  font-size: 0.84375rem;
  color: #a1a1aa;
  text-decoration: none;
  transition: color 200ms ease;
}

.ui-v2 .footer-link:hover { color: #ffffff; }

.ui-v2 .footer-info {
  font-size: 0.84375rem;
  color: #a1a1aa;
  margin: 0;
  line-height: 1.5;
}

/* 在线客服胶囊 */
.ui-v2 .footer-service-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem 0.5rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #ffffff;
  background: rgba(22, 24, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  cursor: pointer;
  margin-top: 1.25rem;
  transition: all 200ms ease;
}

.ui-v2 .footer-service-btn:hover {
  background: rgba(35, 38, 54, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
}

/* 底部版权行 */
.ui-v2 .footer-bottom {
  width: 85%;
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.ui-v2 .footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: #71717a;
}

@media (max-width: 768px) {
  .ui-v2 .footer-bottom-inner { flex-direction: column; text-align: center; gap: 0.5rem; }
}

.ui-v2 .footer-bottom-inner p { margin: 0; }

/* ============================================== 页面留白补偿 ============================================== */

/* 浮动 nav 会遮挡部分页面顶部，用 padding-top 推开内容 */
body.ui-v2 { padding-top: calc(1.5rem + 48px + 1.5rem); }

/* 旧 nav/footer 容器不再使用 class 模式（JS 直接 fill innerHTML） */
