/* 头部：白底，高 45px（原 36），1px 绿色下边框（与历史记录开奖卡片边框同色 #07c160） */
html.kj-port-boot .nav .header {
  --kj-head-h: 45px;
  --kj-green: #07c160;
  background: #fff !important;
  color: #333;
  height: var(--kj-head-h) !important;
  line-height: var(--kj-head-h) !important;
  border-bottom: 1px solid var(--kj-green);
  box-sizing: content-box;
}
/* 返回键随头部加高并居中 */
html.kj-port-boot .nav .header .rp-back {
  height: var(--kj-head-h);
  width: 42px;
}
html.kj-port-boot .nav .header .rp-back img {
  width: 30px;
  height: 30px;
  filter: brightness(0) opacity(.7);
}
/* 标题 logo 垂直居中 */
html.kj-port-boot .nav .header .rp-title-logo {
  height: 32px;
  margin: calc((var(--kj-head-h) - 32px) / 2) auto;
}
/* 年份下拉：放大，字体加大，白底头部上加边框 */
html.kj-port-boot .nav .header .rp-year-top {
  height: 32px;
  top: calc((var(--kj-head-h) - 32px) / 2);
  border: 1px solid #c8c8c8;
  border-radius: 16px;
  color: #333;
  background: #f7f7f7;
  font-size: 15px;
  padding: 0 10px;
}

/* 开奖记录页右上角：与挑码助手 tool.html 同一套三横菜单 */
.nav .header { position: relative; z-index: 5; }
.nav .header > img:nth-of-type(2) {
  visibility: hidden;
  pointer-events: none;
}
.nav .header .menu-wrap {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 6;
}
.nav .header .header-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nav .header .header-icon-btn:active { opacity: .75; }
.nav .header .icon-menu-lines {
  width: 20px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.nav .header .icon-menu-lines span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}
.nav .header .menu-dropdown {
  position: absolute;
  top: 36px;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 20;
  min-width: 128px;
  display: none;
  overflow: hidden;
}
.nav .header .menu-dropdown.show { display: block; }
.nav .header .menu-dropdown a {
  display: block;
  padding: 10px 14px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}
.nav .header .menu-dropdown a:last-child { border-bottom: none; }
.nav .header .menu-dropdown a:active { background: #f5f5f5; }

/* 右上角三横菜单 */

/* 主标签栏只展示前 6 个；第 7 项「生成复式」只在三横菜单里 */
html.kj-port-boot .nav .kind > div:nth-child(n+7) { display: none !important; }

html.kj-port-boot .nav .header .kj-menu-btn {
  position: absolute;
  right: 0;
  top: 0;
  width: 46px;
  height: var(--kj-head-h);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
html.kj-port-boot .nav .header .kj-menu-btn i {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--kj-green);
  transition: transform .18s, opacity .18s;
}
html.kj-port-boot .nav .header .kj-menu-btn.on i:nth-child(1) { transform: translateY(8px) rotate(45deg); }
html.kj-port-boot .nav .header .kj-menu-btn.on i:nth-child(2) { opacity: 0; }
html.kj-port-boot .nav .header .kj-menu-btn.on i:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 历史记录/开奖日期下右上角有年份下拉，向左让出菜单按钮位置 */
html.kj-port-boot .nav .header .rp-year-top { right: 48px; max-width: 100px; }
/* 年份下拉显示时，标题 logo 在「返回键 ~ 年份下拉」之间居中，避免被压住 */
html.kj-record-on .nav .header .rp-title-logo {
  position: absolute;
  left: 42px;
  right: 150px;
  top: 0;
  margin: calc((var(--kj-head-h) - 32px) / 2) auto;
  max-width: calc(100% - 198px);
}

.kj-menu-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.kj-menu-layer[hidden] { display: none !important; }
.kj-menu-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
}
.kj-menu {
  position: absolute;
  top: 50px;
  right: 6px;
  width: 168px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  padding: 6px 0;
  overflow: hidden;
  animation: kjMenuIn .16s ease-out;
}
@media (min-width: 721px) {
  .kj-menu { right: calc(50% - 360px + 6px); }
}
@keyframes kjMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.kj-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}
.kj-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 16px;
  color: #333;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kj-menu-item:active { background: #f4f8f4; }
.kj-menu-item.on { color: #ff6500; font-weight: 600; }
.kj-menu-item.extra { margin-top: 4px; border-top: 1px solid #e6e6e6; padding-top: 4px; }
.kj-menu-item img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex: none;
}
