
/* Tune夜 · 全站公共导航
   PC：单行，导航独立横滑
   手机：双行，第二行独立横滑
   不限制后台配置的栏目数量
*/

:root {
  --tn-bg: #071014;
  --tn-text: #f3f7f9;
  --tn-muted: #9aafbb;
  --tn-line: rgba(207, 229, 240, .14);
  --tn-mint: #72f5dd;
  --tn-grad: linear-gradient(
    100deg, #72f5dd, #ffb0d2, #c799ff
  );
}

.tn-header,
.tn-header * {
  box-sizing: border-box;
}

.tn-header {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  background: rgba(7, 16, 20, .96);
  border-bottom: 1px solid var(--tn-line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tn-header a {
  text-decoration: none;
}

.tn-shell {
  width: min(calc(100% - 48px), 1370px);
  margin: auto;
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
}

/* 原始品牌 Logo，保持图片比例 */
.tn-logo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 135px;
  color: var(--tn-text);
  font-size: 24px;
  font-weight: 750;
  white-space: nowrap;
}

.tn-logo img {
  display: block;
  max-width: 145px;
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* 栏目滚动容器：这是唯一需要横向滚动的区域 */
.tn-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.tn-scroll::-webkit-scrollbar {
  display: none;
}

.tn-scroll.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

/* 栏目数量不限、永不换行 */
.tn-menu {
  display: flex;
  align-items: center;
  width: max-content;
  min-width: 100%;
  gap: 7px;
}

.tn-menu-item {
  position: relative;
  flex: 0 0 auto;
  min-width: 78px;
  min-height: 58px;
  padding: 10px 14px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  border: 1px solid transparent;
  border-radius: 12px;
  color: #a9b9c4;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}

.tn-menu-item:hover {
  color: #fff;
  background: rgba(183, 217, 227, .055);
  border-color: rgba(202, 224, 240, .1);
}

.tn-menu-item.is-active {
  color: #fff;
  background: linear-gradient(
    145deg,
    rgba(114, 245, 221, .1),
    rgba(199, 153, 255, .08)
  );
  border-color: rgba(207, 226, 238, .15);
}

.tn-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: .02em;
}

.tn-subtitle {
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: .16em;
  font-weight: 500;
  color: #859aa8;
}

.tn-menu-item.is-active .tn-subtitle {
  color: #a8eade;
}

/* 指示线独立放在下方，不能穿过英文 */
.tn-menu-item.is-active::after {
  content: "";
  position: absolute;
  width: 32px;
  height: 3px;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: var(--tn-grad);
}

/* 右侧入口始终保留自己的空间 */
.tn-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  margin-left: auto;
}

.tn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 15px;
  gap: 7px;
  border: 1px solid var(--tn-line);
  border-radius: 999px;
  color: #e5eef1;
  background: rgba(255, 255, 255, .018);
  font-size: 12px;
  white-space: nowrap;
}

.tn-action:hover {
  border-color: rgba(114, 245, 221, .42);
}

.tn-action.is-user {
  background: rgba(114, 245, 221, .06);
}

.tn-action svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tn-header a:focus-visible {
  outline: 2px solid var(--tn-mint);
  outline-offset: 2px;
}

/* 平板/手机：两行结构 */
@media (max-width: 800px) {
  .tn-shell {
    width: calc(100% - 30px);
    min-height: 0;
    padding: 11px 0 5px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 10px;
  }

  .tn-logo {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    font-size: 22px;
  }

  .tn-logo img {
    max-width: 133px;
    max-height: 44px;
  }

  .tn-actions {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
  }

  .tn-action {
    min-width: 37px;
    min-height: 37px;
    padding: 8px 11px;
  }

  .tn-action-label {
    display: none;
  }

  .tn-action svg {
    width: 19px;
    height: 19px;
  }

  .tn-scroll {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tn-menu {
    min-width: 0;
    gap: 5px;
  }

  .tn-menu-item {
    min-width: 73px;
    min-height: 59px;
    padding: 10px 11px 12px;
  }

  .tn-name {
    font-size: 14px;
  }

  .tn-subtitle {
    font-size: 8px;
  }

  .tn-menu-item.is-active::after {
    bottom: 4px;
  }
}

@media (max-width: 375px) {
  .tn-shell {
    width: calc(100% - 24px);
  }

  .tn-menu-item {
    min-width: 69px;
    padding-left: 9px;
    padding-right: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tn-scroll {
    scroll-behavior: auto;
  }

  .tn-menu-item {
    transition: none;
  }
}

/* 登录/注册入口：PC 显示文字，手机保留明确可点击图标 */
.tn-action.is-login {
  border-color: rgba(114,245,221,.28);
  background: linear-gradient(110deg,rgba(114,245,221,.12),rgba(199,153,255,.10));
}
@media (max-width: 800px) {
  .tn-actions { gap: 6px; }
  .tn-action { padding: 8px; min-width: 37px; }
  .tn-action.is-login { min-width: 39px; }
}
