.layout {
  display: flex;
  flex-direction: column;
  position: relative;
}

.layout__header {
  flex-shrink: 0;
  background-color: #ffffff;
  box-shadow: 0px 0px 20px 0px rgba(15, 56, 104, 0.1);
  position: sticky;
  top: 0;
  z-index: 999;
}

.layout__content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: linear-gradient(180deg, #eff8ff 0%, #fdfeff 100%), #ffffff;
}

.el-popper {
  width: auto !important;
}

/* 导航栏核心样式 */
.navbar {
  width: 65%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* 导航菜单 */
.navbar__menu {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 50px;
}

.navbar__menu .logo {
  height: 30px;
  cursor: pointer;
}

.navbar__menu .nav-links {
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar__menu .nav-links__panel {
  display: flex;
  align-items: center;
  gap: 36px;
}

.navbar__menu .nav-links__list {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 36px;
}

.navbar__menu .nav-links .link {
  height: 100%;
  line-height: 60px;
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 400;
  font-size: 16px;
  color: #333333;
  box-sizing: border-box;
  transition: all 0.2s ease;
  cursor: pointer;
}

.navbar__menu .nav-links .link:hover {
  color: #1a25ff;
}

.navbar__menu .nav-links .link.router-link-exact-active,
.navbar__menu .nav-links .link.link-active {
  font-weight: bold;
  color: #1a25ff;
}

.navbar__menu .nav-links__divider {
  display: none;
}

/* 导航操作区 */
.navbar__actions {
  display: flex;
  align-items: center;
}

.navbar__actions .label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 36px;
  cursor: pointer;
}

.navbar__actions .label img {
  width: 20px;
}

.navbar__actions .label p {
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 400;
  font-size: 14px;
  color: #333333;
}

.navbar__actions__user {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 100%;
  min-height: 44px;
  padding: 0 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

/* 确保子元素居中 */
.navbar__actions__user > * {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 确保 Element Plus 组件可以正常工作 */
.navbar__actions__user .el-dropdown,
.navbar__actions__user .el-tooltip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* 图标样式 */
.navbar__actions__user [class^="i-svg:"] {
  font-size: 18px;
  line-height: 1;
  color: var(--el-text-color-regular);
  transition: color 0.3s;
}

.navbar__actions__user:hover {
  background: rgba(0, 0, 0, 0.04);
}

.navbar__actions__user:hover [class^="i-svg:"] {
  color: var(--el-color-primary);
}

.navbar__actions__user .user-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 8px;
}

.navbar__actions__user .user-profile__avatar {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.navbar__actions__user .user-profile__name {
  margin-left: 8px;
  color: var(--el-text-color-regular);
  white-space: nowrap;
  transition: color 0.3s;
}

/* 移动端操作区 */
.navbar__mobile-actions {
  display: none;
  align-items: center;
  gap: 12px;
}

/* 图标按钮 */
.icon-btn {
  border: 1px solid #e3e6ef;
  background: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #0f3868;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  box-shadow: 0px 6px 12px rgba(15, 56, 104, 0.12);
  color: #1a25ff;
}

/* 汉堡菜单 */
.hamburger {
  position: relative;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  top: 6px;
}

.hamburger.is-active {
  background: transparent;
}

.hamburger.is-active::before {
  top: 0;
  transform: rotate(45deg);
}

.hamburger.is-active::after {
  top: 0;
  transform: rotate(-45deg);
}

/* 移动端登录区 */
.mobile-auth {
  display: none;
}

/* 响应式适配 - 1200px 以下 */
@media (max-width: 1200px) {
  .navbar {
    width: 80%;
  }
}

/* 响应式适配 - 992px 以下 */
@media (max-width: 992px) {
  .navbar {
    width: 90%;
  }
}

/* 响应式适配 - 768px 以下（移动端核心样式） */
@media (max-width: 768px) {
  .navbar {
    width: 100%;
    height: 64px;
    padding: 0 16px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0px 12px 30px rgba(15, 56, 104, 0.08);
    position: relative;
  }

  .navbar__menu {
    flex: 1;
    gap: 16px;
  }

  .navbar__menu .logo {
    height: 26px;
  }

  .navbar__actions {
    display: none;
  }

  .navbar__mobile-actions {
    display: flex;
  }

  .navbar .nav-links {
    position: absolute;
    top: 74px;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
    padding: 0;
    border-radius: 0 0 28px 28px;
    border: none;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    z-index: 5;
  }

  .navbar .nav-links__panel {
    width: 100%;
    margin: 0;
    background: #ffffff;
    border-radius: 0 0 28px 28px;
    border: 1px solid #dfe5ff;
    border-top: none;
    box-shadow: 0px 24px 48px rgba(15, 56, 104, 0.16);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .navbar .nav-links__list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links__divider {
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd4ff, transparent);
    border-radius: 999px;
  }

  .navbar .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .navbar .nav-links .link {
    width: 100%;
    line-height: 1.5;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #ecf0ff;
    background: #f9faff;
    font-size: 16px;
    font-weight: 600;
    color: #14213a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  }

  .navbar .nav-links .link.router-link-exact-active,
  .navbar .nav-links .link.link-active {
    border-color: #1a25ff;
    background: rgba(26, 37, 255, 0.08);
  }

  .mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .mobile-auth__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid #ecf0ff;
    background: linear-gradient(135deg, #f9fbff 0%, #ffffff 100%);
    box-shadow: 0px 16px 32px rgba(15, 56, 104, 0.12);
  }

  .mobile-auth__avatar {
    width: 30px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-auth__avatar img {
    width: 100%;
  }

  .mobile-auth__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-auth__name {
    font-size: 16px;
    color: #0f1f3d;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-auth__hint {
    font-size: 13px;
    color: #5a6480;
  }

  .mobile-auth__actions {
    display: flex;
    gap: 12px;
    width: 100%;
  }

  .mobile-auth__actions--stack {
    flex-direction: column;
  }

  .mobile-auth__actions--inline {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .mobile-auth__divider {
    color: #999999;
    font-size: 14px;
    user-select: none;
  }

  .mobile-auth__btn {
    flex: 1;
    width: 100%;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 3px 0;
    box-sizing: border-box;
  }

  .mobile-auth__btn--login {
    background: transparent;
    color: #1a25ff;
    border: none;
    padding: 0;
    justify-content: center;
    height: auto;
    min-height: auto;
    width: auto;
    flex: none;
  }

  .mobile-auth__btn--login:active {
    opacity: 0.8;
  }

  .mobile-auth__btn--register {
    background: transparent;
    color: #1a25ff;
    border: none;
    padding: 0;
    justify-content: center;
    height: auto;
    min-height: auto;
    width: auto;
    flex: none;
  }

  .mobile-auth__btn--register:active {
    opacity: 0.8;
  }

  .mobile-auth__btn--primary {
    width: 100%;
    line-height: 1.5;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #ecf0ff;
    background: #f9faff;
    font-size: 16px;
    font-weight: 600;
    color: #14213a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  }

  .mobile-auth__btn--danger {
    width: 100%;
    line-height: 1.5;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #ecf0ff;
    background: #fff;
    font-size: 14px;
    color: #999;
    text-align: center;
  }
}
