﻿/* TN-Top 新版头部样式 - 独立前缀避免与全局 styles.css 冲突 */
.tn-top {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  position: relative;
}
.tn-logo {
  position: absolute;
  left: calc(50% - 800px);
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 700;
}
.tn-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  position: relative;
}
.tn-logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1890ff;
  text-decoration: none;
}
.tn-logo img {
  height: 32px;
  width: 32px;
}
.tn-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}
.tn-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: #555;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.tn-nav a:hover {
  background: #f5f7fa;
  color: #1890ff;
}
.tn-nav a.active {
  background: #1890ff;
  color: #fff;
}
.tn-search {
  position: absolute;
  left: calc(50% + 600px + 16px);
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
}
.tn-search form {
  display: flex;
  align-items: center;
  background: #f5f7fa;
  border-radius: 20px;
  padding: 6px 12px;
}
.tn-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 15px;
  color: #333;
}
.tn-search button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #1890ff;
  padding: 0 4px;
}
.tn-search button:hover {
  color: #1890ff;
}


/* ====== 移动端响应式 ====== */

/* 平板：换行布局 */
@media (max-width: 1200px) {
  .tn-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 20px;
    gap: 10px;
  }
  .tn-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
  .tn-search {
    order: 2;
    width: 220px;
  }
}

/* 手机：汉堡菜单 */

/* 汉堡按钮 - PC端默认隐藏 */
.tn-menu-btn {
  display: none;
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 20px;
  color: #555;
  cursor: pointer;
  padding: 6px 12px;
  z-index: 1001;
  align-self: center;
}
.tn-menu-btn:hover {
  background: #f5f7fa;
  border-color: #bbb;
}

/* 手机：直接展示所有栏目 */
@media (max-width: 768px) {
  .tn-top {
    position: relative;
  }
  .tn-menu-btn { display: none !important; }
  .tn-nav {
    display: flex !important; /* 直接显示导航 */
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    width: 100%;
    order: 3;
    justify-content: flex-start;
  }
  .tn-nav a {
    flex-shrink: 0;
    padding: 6px 12px;
    border-bottom: none;
    border-radius: 999px;
  }
  .tn-logo {
    position: static !important;
    transform: none !important;
    order: 1;
    flex-shrink: 0;
  }
  .tn-search {
    position: static !important;
    transform: none !important;
    order: 2;
    width: 100% !important;
    max-width: 300px;
    margin: 6px auto 0;
  }
  .tn-inner {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tn-nav-open {
    display: none !important; /* 确保展开的样式不生效 */
  }
}

