/* Vue/Figma global header. Keep all selectors namespaced to avoid legacy custom.css collisions. */

.ts-header-root,
.ts-header-root *,
.ts-header-root *::before,
.ts-header-root *::after {
  box-sizing: border-box;
}

.ts-header-root [hidden] {
  display: none !important;
}

.ts-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 64px;
  border-bottom: 1px solid #dfe3eb;
  z-index: 1020;
  background: rgba(255, 255, 255, 0.96);
  color: #1d2129;
  font-family: "Source Han Sans SC";
}

@supports ((-webkit-backdrop-filter: blur(20px)) or (backdrop-filter: blur(20px))) {
  .ts-header {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }
}

.ts-header__inner {
  display: flex;
  align-items: center;
  width: 1200px;
  height: 64px;
  margin: 0 auto;
}

.ts-header__left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
  width: 788px;
  height: 64px;
}

.ts-header__logo {
  display: block;
  flex-shrink: 0;
  width: 128px;
  height: 64px;
  text-decoration: none;
}

.ts-header .ts-header__logo img {
  display: block;
  width: 128px;
  height: 64px;
  object-fit: contain;
}

.ts-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 644px;
  height: 64px;
}

.ts-header .ts-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 96px;
  height: 64px;
  padding: 0 16px;
  color: #1d2129;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s ease;
}

.ts-nav__link--home {
  width: 64px;
}

.ts-nav__link--intro {
  width: 100px;
}

.ts-nav__link--api {
  padding-right: 10px;
  padding-left: 10px;
}

.ts-header .ts-nav__link:hover {
  color: #3461ff;
}

.ts-header .ts-nav__link.is-active {
  color: #1d2129;
  font-weight: 500;
}

.ts-nav__link.is-active::after {
  content: "";
  position: absolute;
  top: 54px;
  left: 50%;
  width: 24px;
  height: 2px;
  background: #3461ff;
  transform: translateX(-50%);
}

.ts-search-entry {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
  margin-left: 82px;
  padding: 0 18px 0 16px;
  width: 180px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  cursor: text;
}

.ts-search-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #edeef0;
  border-radius: 8px;
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.ts-search-entry::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1.5px;
  background: conic-gradient(from var(--ts-search-angle), #baabff, #9aadff, #e3baf3, #d4dfff, #baabff);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ts-search-entry:hover::before {
  border-color: transparent;
}

.ts-search-entry:hover::after {
  opacity: 1;
  animation: ts-search-flow 1.2s linear infinite;
}

.ts-search-entry__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.ts-header .ts-search-entry__input {
  flex: 1;
  min-width: 0;
  width: 0;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #1d2129;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  cursor: text;
}

.ts-header .ts-search-entry__input::placeholder {
  color: #86909c;
}

.ts-search-entry__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  width: 14px;
  height: 14px;
  border: 0;
  background: transparent;
  color: #86909c;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ts-search-entry__clear:hover {
  color: #1d2129;
}

.ts-header .ts-header__login {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 16px;
  width: 134px;
  height: 40px;
  border-radius: 100px;
  background: #3461ff;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.ts-header .ts-header__login:hover,
.ts-header .ts-header__login:focus {
  background: #2550e8;
  color: #ffffff;
  text-decoration: none;
}

.ts-user {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
  margin-left: 16px;
  height: 40px;
  cursor: pointer;
}

.ts-user::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 12px;
}

.ts-user__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.ts-user__name {
  overflow: hidden;
  min-width: 0;
  margin-left: 8px;
  max-width: 96px;
  color: #1d2129;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.ts-user:hover .ts-user__name,
.ts-user:focus-within .ts-user__name {
  color: #3461ff;
}

.ts-user__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 1;
  min-width: 96px;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(29, 33, 41, 0.12);
  list-style: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ts-user:hover .ts-user__menu,
.ts-user:focus-within .ts-user__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ts-header .ts-user__menu-link {
  display: block;
  padding: 6px 12px;
  border-radius: 4px;
  color: #4e5969;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.ts-header .ts-user__menu-link:hover,
.ts-header .ts-user__menu-link:focus {
  background: #f2f3f5;
  color: #3461ff;
  text-decoration: none;
}

/* ===================== Search overlay ===================== */

.ts-search-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1030;
  font-family: "Source Han Sans SC";
}

.ts-search-mask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.ts-search-panel {
  position: absolute;
  top: 8px;
  left: 50%;
  padding: 24px;
  width: 900px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%) border-box;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ts-search-overlay.is-open .ts-search-panel {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ts-search-inputwrap {
  position: relative;
  margin-left: auto;
  width: 180px;
  height: 48px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ts-search-panel.is-ready .ts-search-inputwrap {
  width: 852px;
}

.ts-header-root .ts-search-input {
  padding: 0 36px 0 12px;
  width: 100%;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(306.5deg, #002bff 0%, #1051f5 60.73%, #9225ff 100%) border-box;
  color: #1d2129;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  caret-color: #1d2129;
}

.ts-header-root .ts-search-input::placeholder {
  color: #86909c;
}

.ts-header-root .ts-search-input.ts-search-input--clearable {
  padding-right: 78px;
}

.ts-search-submit,
.ts-search-clear {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.ts-search-submit {
  top: 16px;
  right: 12px;
  width: 16px;
  height: 16px;
  color: #86909c;
  transition: color 0.2s ease;
}

.ts-search-panel.is-filled .ts-search-submit {
  color: #1d2129;
}

.ts-search-clear {
  top: 16px;
  right: 53px;
  width: 16px;
  height: 16px;
  color: #1d2129;
}

.ts-search-divider {
  position: absolute;
  top: 18px;
  right: 40px;
  width: 1px;
  height: 12px;
  background: #e5e6eb;
}

.ts-search-hot,
.ts-search-recent,
.ts-search-results,
.ts-search-empty {
  opacity: 0;
  transition: opacity 0.2s ease 0.15s;
}

.ts-search-panel.is-ready .ts-search-hot,
.ts-search-panel.is-ready .ts-search-recent,
.ts-search-panel.is-ready .ts-search-results,
.ts-search-panel.is-ready .ts-search-empty {
  opacity: 1;
}

.ts-search-hot,
.ts-search-recent {
  margin-top: 16px;
}

.ts-search-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
}

.ts-search-section-title {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #4e5969;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0;
}

.ts-search-section-title svg {
  display: block;
  flex-shrink: 0;
}

.ts-search-hot-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ts-search-hot-list li {
  display: flex;
  align-items: center;
  height: 22px;
  cursor: pointer;
}

.ts-search-hot-list li + li {
  margin-top: 12px;
}

.ts-search-hot-list em {
  width: 10px;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 22px;
}

.ts-search-hot-list span {
  margin-left: 12px;
  color: #1d2129;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
}

/* 最近搜索 + 热门搜索组合态：与 Figma 4829:1619 一致，行高升为 24 */
.ts-search-panel.is-with-recent .ts-search-hot-list li {
  height: 24px;
}

.ts-search-panel.is-with-recent .ts-search-hot-list em {
  font-size: 16px;
  line-height: 24px;
}

.ts-search-panel.is-with-recent .ts-search-hot-list span {
  line-height: 24px;
}

.ts-search-recent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.ts-search-tag {
  display: inline-flex;
  align-items: center;
  max-width: 262px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: transparent;
  color: #4e5969;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 19.6px;
  white-space: normal;
  word-break: break-all;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ts-search-tag:hover {
  border-color: #c9cdd4;
  color: #1d2129;
}

.ts-search-clearall {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4e5969;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 19.6px;
  cursor: pointer;
}

.ts-search-clearall:hover {
  color: #1d2129;
}

.ts-search-results {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  /* 结果区高度固定：超出时在面板内纵向滚动，不撑开整体布局 */
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ts-search-results li {
  cursor: pointer;
}

.ts-search-results li + li {
  margin-top: 16px;
}

.ts-search-result-title {
  margin: 0;
  color: #1d2129;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0;
}

.ts-search-result-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 4px 0 0;
  color: #86909c;
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
}

.ts-search-hl {
  color: #3461ff;
  font-weight: 500;
}

.ts-search-empty {
  padding-top: 24px;
  color: #86909c;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  text-align: center;
}

@property --ts-search-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes ts-search-flow {
  to {
    --ts-search-angle: 360deg;
  }
}

@media (max-width: 1250px) {
  .ts-header__inner {
    width: 100%;
    padding: 0 24px;
  }

  .ts-search-entry {
    display: none;
  }

  .ts-header__login,
  .ts-user {
    margin-left: auto;
  }
}

@media (max-width: 980px) {
  .ts-nav {
    display: none;
  }

  .ts-header__left {
    width: auto;
  }
}
