﻿/* ============================================================
   顶栏 + 侧栏 结构对齐（参照 cloud.divcloud.cn 控制台实测值）

   参考站真实结构：
     · 顶栏整宽 50px（含 logo 区 190×49 与「控制台」），底边 1px #EBEBEB
     · 侧栏从顶栏下方 50px 处开始，宽 190px，右线 1px #ECECEC
     · 侧栏首项距顶 60px（50 + 10），项高 40，图标左距 10，文字左距 32
     · 文字 14.5px/400 #202A3A，图标 15px 同色，组间 12px
     · 侧栏底部「收起侧栏」189×44，上边框 1px #ECECEC，图标居中

   实现方式：侧栏脱离文档流（fixed 于 50px 处），使顶栏自然横跨整宽；
             主区内边距左移 190px 让出侧栏位置。
   回退：删掉 header.php 中 nav.css 的 <link> 即可。
   ============================================================ */

/* ---------- 顶栏 ---------- */
.el-header {
  width: 100% !important;      /* 覆盖 common.css 的 calc(100% - 160px) */
  left: 0 !important;
  right: 0 !important;
  height: 50px !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #EBEBEB;
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.05);
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  position: fixed !important;
  top: 0;
  z-index: 6;
  box-sizing: border-box;
}

/* logo 区：190px，与侧栏同宽，logo 图片 190×49 contain */
.hp-brand {
  width: 190px;
  height: 49px;
  flex: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.hp-brand-logo {
  width: 100%;
  height: 49px;
  object-fit: contain;
  padding: 0 34px;
  box-sizing: border-box;
}

/* 「控制台」入口（参考站位于 logo 右侧 190px 处，宽约 89px） */
.hp-console {
  height: 49px;
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14.5px;
  color: #202A3A;
  cursor: pointer;
  white-space: nowrap;
}

.hp-console i {
  font-size: 15px;
  margin-right: 6px;
  color: #202A3A;
}

.hp-console:hover,
.hp-console:hover i {
  color: #0052D9;
}

.header-left {
  flex: none;
}

.header-right {
  margin-left: auto;
}

/* ---------- 顶栏右侧：与参考站同规格（4 个 48×49 图标位 + 208 宽账户区） ---------- */
.header-right {
  display: flex;
  align-items: center;
  height: 49px;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  flex: none;
}

.hp-icon-btn {
  width: 48px;
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: none;
  text-decoration: none;
  transition: background-color .15s;
}

.hp-icon-btn:hover {
  background: #F2F3F5;
}

.hp-icon-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

.hp-icon-btn.is-disabled {
  cursor: default;
}

.hp-icon-btn.is-disabled:hover {
  background: transparent;
}

.hp-cart-badge {
  position: absolute;
  top: 10px;
  left: 26px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #F53F3F;
  color: #FFFFFF;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

.hp-login {
  height: 49px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  font-size: 14.5px;
  color: #333333;
  cursor: pointer;
}

/* 账户区：跟在图标后面，宽度随内容收，名字紧贴头像 */
.hp-account-wrap {
  width: auto !important;
  flex: none;
}

.hp-account {
  width: auto !important;
  height: 49px;
  padding: 0 0 0 14px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  cursor: pointer;
}

.hp-user-name {
  font-size: 14.5px;
  font-weight: 400;
  color: #333333;
  max-width: 143px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.hp-topbar-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 0;
  object-fit: cover;
  display: block;
  margin: 0 !important;
}

/* ---------- 账户下拉面板（结构对齐参考站） ---------- */
.hp-account-wrap {
  position: relative;
}

.hp-account-panel {
  position: absolute;
  top: 54px;
  right: 0;
  width: 380px;
  background: #FFFFFF;
  box-shadow: 0 12px 32px rgba(17, 28, 50, 0.14);
  z-index: 20;
  box-sizing: border-box;
}

.hp-panel-identity {
  padding: 16px 20px 14px;
}

.hp-panel-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hp-panel-name-text {
  font-size: 15px;
  font-weight: 600;
  color: #1D2129;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-panel-role {
  flex: none;
  height: 20px;
  line-height: 20px;
  padding: 0 6px;
  font-size: 11px;
  color: #0052D9;
  background: #EAF2FF;
  border-radius: 2px;
}

.hp-panel-id {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #86909C;
}

.hp-panel-balance {
  margin: 0 20px 12px;
  padding: 12px 16px;
  background: #F7F8FA;
}

.hp-panel-bal-label {
  font-size: 12.5px;
  color: #86909C;
}

.hp-panel-bal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.hp-panel-bal-value {
  font-size: 22px;
  font-weight: 600;
  color: #1D2129;
}

.hp-panel-recharge {
  height: 32px;
  line-height: 32px;
  padding: 0 18px;
  background: #0052D9;
  color: #FFFFFF;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
}

.hp-panel-recharge:hover {
  background: #0046BE;
}

.hp-panel-list {
  border-top: 1px solid #F2F3F5;
  padding: 4px 0;
}

.hp-panel-item {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 14px;
  color: #202A3A;
  cursor: pointer;
  text-decoration: none;
}

.hp-panel-item:hover {
  background: #F7F8FA;
}

.hp-panel-item i {
  font-size: 16px;
  color: #4E5969;
  width: 18px;
  margin-right: 10px;
  text-align: center;
}

.hp-panel-count {
  margin-left: auto;
  font-size: 13px;
  color: #86909C;
}

.hp-panel-quit {
  border-top: 1px solid #F2F3F5;
  color: #202A3A;
}

.hp-panel-quit i {
  color: #4E5969;
}

.hp-gear {
  font-size: 19px;
  color: #333333;
}

/* ---------- 侧栏：从顶栏下方开始 ---------- */
.el-aside {
  position: fixed !important;
  top: 50px;
  left: 0;
  bottom: 0;
  width: 190px !important;   /* 与 el-main 的 padding-left 严格对齐，避免内容被侧栏压住 */
  height: auto !important;
  background: #FFFFFF !important;
  border-right: 1px solid #ECECEC;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  z-index: 5;
  box-sizing: border-box;
}

.el-aside::-webkit-scrollbar {
  width: 6px;
}

.el-aside::-webkit-scrollbar-track {
  background-color: transparent;
}

.el-aside::-webkit-scrollbar-thumb {
  background-color: #E5E8EF;
  border-radius: 3px;
}

/* ---------- 主区让出侧栏宽度 ---------- */
.el-main {
  padding: 0 !important;        /* 取消 common.css 的 40px 上内边距 */
  padding-top: 50px !important; /* 顶栏 fixed 后为其让位 */
  padding-left: 190px !important;
  background: #F1F2F7;
  box-sizing: border-box;
}

/* ---------- 菜单容器 ---------- */
.menu-top {
  background-color: transparent !important;
  margin-top: 10px;
  flex: none;
}

.line {
  display: none !important;
}

.el-aside .line + .menu-top {
  margin-top: 12px !important;
}

/* ---------- 一级菜单项 ---------- */
.menu-top .el-menu-item,
.menu-top .el-submenu__title {
  background-color: transparent !important;
  color: #202A3A !important;
  height: 40px !important;
  line-height: 40px !important;
  margin: 0 !important;
  padding-left: 10px !important;
  border-radius: 0;
  font-size: 14.5px !important;
  font-weight: 400 !important;
  transition: background-color 0.15s, color 0.15s;
}

.menu-top .el-menu-item i,
.menu-top .el-submenu__title i {
  color: #202A3A !important;
  font-size: 15px !important;
  width: 16px;
  height: auto;
  line-height: 1;
  text-align: center;
  margin-right: 6px;
}

.menu-top .aside-menu-text {
  margin-left: 0;
  font-size: 14.5px;
  font-weight: 400;
  color: inherit;
  line-height: 40px;
}

.menu-top .el-menu-item:hover,
.menu-top .el-submenu__title:hover,
.menu-top .el-menu-item.is-active {
  background-color: #F2F3F5 !important;
  color: #202A3A !important;
  font-weight: 400 !important;
}

.menu-top .el-menu-item.is-active::after {
  display: none !important;
}

/* ---------- 二级菜单 ---------- */
.menu-top .el-submenu .el-menu-item {
  background-color: transparent !important;
  color: #202A3A !important;
  height: 34px !important;
  line-height: 34px !important;
  min-width: auto;
  padding-left: 32px !important;
  margin: 0 !important;
  font-size: 14px !important;
}

.menu-top .el-submenu .el-menu-item:hover,
.menu-top .el-submenu .el-menu-item.is-active {
  background-color: #F2F3F5 !important;
}

/* 展开后的二级菜单容器：清掉 Element 的内联蓝底 */
.menu-top .el-menu--inline,
.menu-top .el-submenu > .el-menu {
  background-color: transparent !important;
}

.menu-top .el-submenu__title .el-submenu__icon-arrow {
  color: #8692B0;
  width: 20px;
  text-align: center;
  margin-right: 4px;
}

/* ---------- 底部「收起侧栏」 ---------- */
.aside-collapse {
  margin-top: auto;
  height: 44px;
  border-top: 1px solid #ECECEC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #202A3A;
  cursor: pointer;
  flex: none;
  transition: background-color 0.15s;
}

.aside-collapse:hover {
  background: #F2F3F5;
}

.aside-collapse i {
  font-size: 15px;
}

/* ---------- 窄屏：与参考站保持一致比例，仅在空间不足时逐级收缩 ---------- */
@media (max-width: 780px) {
  .hp-brand { width: 165px; }

  .hp-brand-logo { padding: 0 16px; }

  .hp-icon-btn { width: 42px; }

  .hp-user-name { max-width: 122px; }
}

/* ---------- 窄屏（≤768px）：侧栏收起为抽屉，与参考站一致 ---------- */
@media (max-width: 768px) {
  .el-aside { display: none !important; }

  .hp-account-panel {
    width: 320px;
  }

  .el-main { padding-left: 0 !important; }

  .hp-brand { display: none !important; }

  .header-left {
    order: -1;
    flex: none;
    padding-left: 6px;
  }

  .header-left .el-input,
  .header-left .left-img { display: none !important; }

  .menu-img {
    display: inline-block !important;
    width: 30px !important;
    height: 30px !important;
    object-fit: contain;
    cursor: pointer;
  }

  .hp-console { padding: 0 8px; }

  .hp-icon-btn { width: 44px; }

  .hp-user-name { max-width: 128px; }
}

/* ---------- 抽屉菜单：浅色化，去掉原来的蓝底 ---------- */
.drawer-menu { background: #FFFFFF !important; width: 238px !important; }

.drawer-menu .drawer-menu-list-top {
  height: calc(100% - 50px);
  overflow-y: auto;
}

.drawer-menu .drawer-menu-top {
  border-bottom: 1px solid #F2F3F5;
}

.drawer-menu .drawer-menu-logo {
  height: 30px;
  width: auto;
  max-width: 160px;
  padding: 0 16px;
  object-fit: contain;
  box-sizing: border-box;
}

.drawer-menu .drawer-menu-list-top::-webkit-scrollbar {
  width: 4px;
}

.drawer-menu::-webkit-scrollbar {
  width: 4px;
}

.drawer-menu::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-menu::-webkit-scrollbar-thumb {
  background: #E5E8EF;
  border-radius: 2px;
}

.drawer-menu .menu-top {
  background-color: transparent !important;
  margin-top: 8px !important;
}

.drawer-menu .el-menu,
.drawer-menu .el-menu--inline {
  background-color: transparent !important;
}

.drawer-menu .el-menu-item,
.drawer-menu .el-submenu__title {
  background-color: transparent !important;
  color: #202A3A !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 14.5px !important;
  font-weight: 400 !important;
  padding-left: 16px !important;
}

.drawer-menu .el-menu-item i,
.drawer-menu .el-submenu__title i {
  color: #202A3A !important;
  font-size: 16px !important;
  width: 16px;
  text-align: center;
  margin-right: 8px;
}

.drawer-menu .el-menu-item:hover,
.drawer-menu .el-submenu__title:hover {
  background-color: #F2F3F5 !important;
}

.drawer-menu .el-menu-item.is-active {
  background-color: #F2F6FE !important;
  color: #0052D9 !important;
}

.drawer-menu .el-menu-item.is-active i {
  color: #0052D9 !important;
}

.drawer-menu .el-submenu .el-menu-item {
  height: 38px !important;
  line-height: 38px !important;
  padding-left: 40px !important;
  font-size: 14px !important;
  color: #4E5969 !important;
}

.drawer-menu .el-submenu__title .el-submenu__icon-arrow {
  color: #8692B0;
  margin-right: 6px;
}

@media (max-width: 620px) {
  .hp-icon-btn { width: 38px; }

  .hp-user-name { display: none; }

  .hp-account { padding: 0 0 0 8px; }
}

/* 全站字体与参考站一致（后台图标字体各自独立，不受影响） */
body, .el-container, .el-aside, .el-header, .el-main, .el-menu-item, .el-menu-item * {
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}


/* ---------- 固定顶栏：全站统一让出 50px（覆盖各页 *-hp.css 的 padding 简写） ---------- */
html body .el-main {
  padding: 0 !important;
  padding-top: 50px !important;
  padding-left: 190px !important;
  box-sizing: border-box !important;
}
html body .el-aside { width: 190px !important; }
/* 内容块不得溢出到侧栏下方 */
html body .el-main > .main-card,
html body .el-main > div { max-width: 100%; box-sizing: border-box; }
/* 窄屏：侧栏隐藏，主区回到整宽 */
@media (max-width: 750px) {
  html body .el-main {
    padding: 12px !important;
    padding-top: 56px !important;
    padding-left: 12px !important;
  }
}
